<?php


abstract class BaseUsuario extends BaseObject  implements Persistent {


	
	protected static $peer;


	
	protected $activo = 1;


	
	protected $rol_id;


	
	protected $titulo = '0';


	
	protected $superadmin = 0;


	
	protected $sobreturnos = 2;


	
	protected $mn = 0;


	
	protected $username;


	
	protected $password;


	
	protected $celular;


	
	protected $email;


	
	protected $created_by;


	
	protected $update_by;


	
	protected $updated_fields;


	
	protected $id;

	
	protected $aRol;

	
	protected $aUsuarioRelatedByCreatedBy;

	
	protected $aUsuarioRelatedByUpdateBy;

	
	protected $collCoberturasRelatedByCreatedBy;

	
	protected $lastCoberturaRelatedByCreatedByCriteria = null;

	
	protected $collCoberturasRelatedByUpdateBy;

	
	protected $lastCoberturaRelatedByUpdateByCriteria = null;

	
	protected $collCredencialsRelatedByCreatedBy;

	
	protected $lastCredencialRelatedByCreatedByCriteria = null;

	
	protected $collCredencialsRelatedByUpdateBy;

	
	protected $lastCredencialRelatedByUpdateByCriteria = null;

	
	protected $collDiasRelatedByCreatedBy;

	
	protected $lastDiaRelatedByCreatedByCriteria = null;

	
	protected $collDiasRelatedByUpdateBy;

	
	protected $lastDiaRelatedByUpdateByCriteria = null;

	
	protected $collEquiposRelatedByUsuarioId;

	
	protected $lastEquipoRelatedByUsuarioIdCriteria = null;

	
	protected $collEquiposRelatedByEquipoId;

	
	protected $lastEquipoRelatedByEquipoIdCriteria = null;

	
	protected $collEquiposRelatedByCreatedBy;

	
	protected $lastEquipoRelatedByCreatedByCriteria = null;

	
	protected $collEquiposRelatedByUpdateBy;

	
	protected $lastEquipoRelatedByUpdateByCriteria = null;

	
	protected $collEstudiosRelatedByCreatedBy;

	
	protected $lastEstudioRelatedByCreatedByCriteria = null;

	
	protected $collEstudiosRelatedByUpdateBy;

	
	protected $lastEstudioRelatedByUpdateByCriteria = null;

	
	protected $collHorariosRelatedByUsuarioId;

	
	protected $lastHorarioRelatedByUsuarioIdCriteria = null;

	
	protected $collHorariosRelatedByCreatedBy;

	
	protected $lastHorarioRelatedByCreatedByCriteria = null;

	
	protected $collHorariosRelatedByUpdateBy;

	
	protected $lastHorarioRelatedByUpdateByCriteria = null;

	
	protected $collHorarioCambiosRelatedByUsuarioId;

	
	protected $lastHorarioCambioRelatedByUsuarioIdCriteria = null;

	
	protected $collHorarioCambiosRelatedByReemplazoId;

	
	protected $lastHorarioCambioRelatedByReemplazoIdCriteria = null;

	
	protected $collHorarioCambiosRelatedByCreatedBy;

	
	protected $lastHorarioCambioRelatedByCreatedByCriteria = null;

	
	protected $collHorarioCambiosRelatedByUpdateBy;

	
	protected $lastHorarioCambioRelatedByUpdateByCriteria = null;

	
	protected $collHorarioCambioTiposRelatedByCreatedBy;

	
	protected $lastHorarioCambioTipoRelatedByCreatedByCriteria = null;

	
	protected $collHorarioCambioTiposRelatedByUpdateBy;

	
	protected $lastHorarioCambioTipoRelatedByUpdateByCriteria = null;

	
	protected $collPacientesRelatedByCreatedBy;

	
	protected $lastPacienteRelatedByCreatedByCriteria = null;

	
	protected $collPacientesRelatedByUpdateBy;

	
	protected $lastPacienteRelatedByUpdateByCriteria = null;

	
	protected $collPlansRelatedByCreatedBy;

	
	protected $lastPlanRelatedByCreatedByCriteria = null;

	
	protected $collPlansRelatedByUpdateBy;

	
	protected $lastPlanRelatedByUpdateByCriteria = null;

	
	protected $collRolsRelatedByCreatedBy;

	
	protected $lastRolRelatedByCreatedByCriteria = null;

	
	protected $collRolsRelatedByUpdateBy;

	
	protected $lastRolRelatedByUpdateByCriteria = null;

	
	protected $collRolCredencialsRelatedByCreatedBy;

	
	protected $lastRolCredencialRelatedByCreatedByCriteria = null;

	
	protected $collRolCredencialsRelatedByUpdateBy;

	
	protected $lastRolCredencialRelatedByUpdateByCriteria = null;

	
	protected $collTurnosRelatedByMedicoId;

	
	protected $lastTurnoRelatedByMedicoIdCriteria = null;

	
	protected $collTurnosRelatedByCreatedBy;

	
	protected $lastTurnoRelatedByCreatedByCriteria = null;

	
	protected $collTurnosRelatedByUpdateBy;

	
	protected $lastTurnoRelatedByUpdateByCriteria = null;

	
	protected $collTurnoCambioEstadosRelatedByCreatedBy;

	
	protected $lastTurnoCambioEstadoRelatedByCreatedByCriteria = null;

	
	protected $collTurnoCambioEstadosRelatedByUpdateBy;

	
	protected $lastTurnoCambioEstadoRelatedByUpdateByCriteria = null;

	
	protected $collTurnoEstadosRelatedByCreatedBy;

	
	protected $lastTurnoEstadoRelatedByCreatedByCriteria = null;

	
	protected $collTurnoEstadosRelatedByUpdateBy;

	
	protected $lastTurnoEstadoRelatedByUpdateByCriteria = null;

	
	protected $collUsuariosRelatedByCreatedBy;

	
	protected $lastUsuarioRelatedByCreatedByCriteria = null;

	
	protected $collUsuariosRelatedByUpdateBy;

	
	protected $lastUsuarioRelatedByUpdateByCriteria = null;

	
	protected $collUsuarioEstudiosRelatedByUsuarioId;

	
	protected $lastUsuarioEstudioRelatedByUsuarioIdCriteria = null;

	
	protected $collUsuarioEstudiosRelatedByCreatedBy;

	
	protected $lastUsuarioEstudioRelatedByCreatedByCriteria = null;

	
	protected $collUsuarioEstudiosRelatedByUpdateBy;

	
	protected $lastUsuarioEstudioRelatedByUpdateByCriteria = null;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

	
	public function getActivo()
	{

		return $this->activo;
	}

	
	public function getRolId()
	{

		return $this->rol_id;
	}

	
	public function getTitulo()
	{

		return $this->titulo;
	}

	
	public function getSuperadmin()
	{

		return $this->superadmin;
	}

	
	public function getSobreturnos()
	{

		return $this->sobreturnos;
	}

	
	public function getMn()
	{

		return $this->mn;
	}

	
	public function getUsername()
	{

		return $this->username;
	}

	
	public function getPassword()
	{

		return $this->password;
	}

	
	public function getCelular()
	{

		return $this->celular;
	}

	
	public function getEmail()
	{

		return $this->email;
	}

	
	public function getCreatedBy()
	{

		return $this->created_by;
	}

	
	public function getUpdateBy()
	{

		return $this->update_by;
	}

	
	public function getUpdatedFields()
	{

		return $this->updated_fields;
	}

	
	public function getId()
	{

		return $this->id;
	}

	
	public function setActivo($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->activo !== $v || $v === 1) {
			$this->activo = $v;
			$this->modifiedColumns[] = UsuarioPeer::ACTIVO;
		}

	} 
	
	public function setRolId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->rol_id !== $v) {
			$this->rol_id = $v;
			$this->modifiedColumns[] = UsuarioPeer::ROL_ID;
		}

		if ($this->aRol !== null && $this->aRol->getId() !== $v) {
			$this->aRol = null;
		}

	} 
	
	public function setTitulo($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->titulo !== $v || $v === '0') {
			$this->titulo = $v;
			$this->modifiedColumns[] = UsuarioPeer::TITULO;
		}

	} 
	
	public function setSuperadmin($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->superadmin !== $v || $v === 0) {
			$this->superadmin = $v;
			$this->modifiedColumns[] = UsuarioPeer::SUPERADMIN;
		}

	} 
	
	public function setSobreturnos($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->sobreturnos !== $v || $v === 2) {
			$this->sobreturnos = $v;
			$this->modifiedColumns[] = UsuarioPeer::SOBRETURNOS;
		}

	} 
	
	public function setMn($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->mn !== $v || $v === 0) {
			$this->mn = $v;
			$this->modifiedColumns[] = UsuarioPeer::MN;
		}

	} 
	
	public function setUsername($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->username !== $v) {
			$this->username = $v;
			$this->modifiedColumns[] = UsuarioPeer::USERNAME;
		}

	} 
	
	public function setPassword($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->password !== $v) {
			$this->password = $v;
			$this->modifiedColumns[] = UsuarioPeer::PASSWORD;
		}

	} 
	
	public function setCelular($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->celular !== $v) {
			$this->celular = $v;
			$this->modifiedColumns[] = UsuarioPeer::CELULAR;
		}

	} 
	
	public function setEmail($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->email !== $v) {
			$this->email = $v;
			$this->modifiedColumns[] = UsuarioPeer::EMAIL;
		}

	} 
	
	public function setCreatedBy($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->created_by !== $v) {
			$this->created_by = $v;
			$this->modifiedColumns[] = UsuarioPeer::CREATED_BY;
		}

		if ($this->aUsuarioRelatedByCreatedBy !== null && $this->aUsuarioRelatedByCreatedBy->getId() !== $v) {
			$this->aUsuarioRelatedByCreatedBy = null;
		}

	} 
	
	public function setUpdateBy($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->update_by !== $v) {
			$this->update_by = $v;
			$this->modifiedColumns[] = UsuarioPeer::UPDATE_BY;
		}

		if ($this->aUsuarioRelatedByUpdateBy !== null && $this->aUsuarioRelatedByUpdateBy->getId() !== $v) {
			$this->aUsuarioRelatedByUpdateBy = null;
		}

	} 
	
	public function setUpdatedFields($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->updated_fields !== $v) {
			$this->updated_fields = $v;
			$this->modifiedColumns[] = UsuarioPeer::UPDATED_FIELDS;
		}

	} 
	
	public function setId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->id !== $v) {
			$this->id = $v;
			$this->modifiedColumns[] = UsuarioPeer::ID;
		}

	} 
	
	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		try {

			$this->activo = $rs->getInt($startcol + 0);

			$this->rol_id = $rs->getInt($startcol + 1);

			$this->titulo = $rs->getString($startcol + 2);

			$this->superadmin = $rs->getInt($startcol + 3);

			$this->sobreturnos = $rs->getInt($startcol + 4);

			$this->mn = $rs->getInt($startcol + 5);

			$this->username = $rs->getString($startcol + 6);

			$this->password = $rs->getString($startcol + 7);

			$this->celular = $rs->getInt($startcol + 8);

			$this->email = $rs->getString($startcol + 9);

			$this->created_by = $rs->getInt($startcol + 10);

			$this->update_by = $rs->getInt($startcol + 11);

			$this->updated_fields = $rs->get($startcol + 12);

			$this->id = $rs->getInt($startcol + 13);

			$this->resetModified();

			$this->setNew(false);

						return $startcol + 14; 
		} catch (Exception $e) {
			throw new PropelException("Error populating Usuario object", $e);
		}
	}

	
	public function delete($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(UsuarioPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			UsuarioPeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public function save($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(UsuarioPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			$affectedRows = $this->doSave($con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	protected function doSave($con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;


												
			if ($this->aRol !== null) {
				if ($this->aRol->isModified()) {
					$affectedRows += $this->aRol->save($con);
				}
				$this->setRol($this->aRol);
			}

			if ($this->aUsuarioRelatedByCreatedBy !== null) {
				if ($this->aUsuarioRelatedByCreatedBy->isModified()) {
					$affectedRows += $this->aUsuarioRelatedByCreatedBy->save($con);
				}
				$this->setUsuarioRelatedByCreatedBy($this->aUsuarioRelatedByCreatedBy);
			}

			if ($this->aUsuarioRelatedByUpdateBy !== null) {
				if ($this->aUsuarioRelatedByUpdateBy->isModified()) {
					$affectedRows += $this->aUsuarioRelatedByUpdateBy->save($con);
				}
				$this->setUsuarioRelatedByUpdateBy($this->aUsuarioRelatedByUpdateBy);
			}


						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = UsuarioPeer::doInsert($this, $con);
					$affectedRows += 1; 										 										 
					$this->setId($pk);  
					$this->setNew(false);
				} else {
					$affectedRows += UsuarioPeer::doUpdate($this, $con);
				}
				$this->resetModified(); 			}

			if ($this->collCoberturasRelatedByCreatedBy !== null) {
				foreach($this->collCoberturasRelatedByCreatedBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collCoberturasRelatedByUpdateBy !== null) {
				foreach($this->collCoberturasRelatedByUpdateBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collCredencialsRelatedByCreatedBy !== null) {
				foreach($this->collCredencialsRelatedByCreatedBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collCredencialsRelatedByUpdateBy !== null) {
				foreach($this->collCredencialsRelatedByUpdateBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collDiasRelatedByCreatedBy !== null) {
				foreach($this->collDiasRelatedByCreatedBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collDiasRelatedByUpdateBy !== null) {
				foreach($this->collDiasRelatedByUpdateBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collEquiposRelatedByUsuarioId !== null) {
				foreach($this->collEquiposRelatedByUsuarioId as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collEquiposRelatedByEquipoId !== null) {
				foreach($this->collEquiposRelatedByEquipoId as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collEquiposRelatedByCreatedBy !== null) {
				foreach($this->collEquiposRelatedByCreatedBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collEquiposRelatedByUpdateBy !== null) {
				foreach($this->collEquiposRelatedByUpdateBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collEstudiosRelatedByCreatedBy !== null) {
				foreach($this->collEstudiosRelatedByCreatedBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collEstudiosRelatedByUpdateBy !== null) {
				foreach($this->collEstudiosRelatedByUpdateBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collHorariosRelatedByUsuarioId !== null) {
				foreach($this->collHorariosRelatedByUsuarioId as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collHorariosRelatedByCreatedBy !== null) {
				foreach($this->collHorariosRelatedByCreatedBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collHorariosRelatedByUpdateBy !== null) {
				foreach($this->collHorariosRelatedByUpdateBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collHorarioCambiosRelatedByUsuarioId !== null) {
				foreach($this->collHorarioCambiosRelatedByUsuarioId as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collHorarioCambiosRelatedByReemplazoId !== null) {
				foreach($this->collHorarioCambiosRelatedByReemplazoId as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collHorarioCambiosRelatedByCreatedBy !== null) {
				foreach($this->collHorarioCambiosRelatedByCreatedBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collHorarioCambiosRelatedByUpdateBy !== null) {
				foreach($this->collHorarioCambiosRelatedByUpdateBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collHorarioCambioTiposRelatedByCreatedBy !== null) {
				foreach($this->collHorarioCambioTiposRelatedByCreatedBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collHorarioCambioTiposRelatedByUpdateBy !== null) {
				foreach($this->collHorarioCambioTiposRelatedByUpdateBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collPacientesRelatedByCreatedBy !== null) {
				foreach($this->collPacientesRelatedByCreatedBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collPacientesRelatedByUpdateBy !== null) {
				foreach($this->collPacientesRelatedByUpdateBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collPlansRelatedByCreatedBy !== null) {
				foreach($this->collPlansRelatedByCreatedBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collPlansRelatedByUpdateBy !== null) {
				foreach($this->collPlansRelatedByUpdateBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collRolsRelatedByCreatedBy !== null) {
				foreach($this->collRolsRelatedByCreatedBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collRolsRelatedByUpdateBy !== null) {
				foreach($this->collRolsRelatedByUpdateBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collRolCredencialsRelatedByCreatedBy !== null) {
				foreach($this->collRolCredencialsRelatedByCreatedBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collRolCredencialsRelatedByUpdateBy !== null) {
				foreach($this->collRolCredencialsRelatedByUpdateBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collTurnosRelatedByMedicoId !== null) {
				foreach($this->collTurnosRelatedByMedicoId as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collTurnosRelatedByCreatedBy !== null) {
				foreach($this->collTurnosRelatedByCreatedBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collTurnosRelatedByUpdateBy !== null) {
				foreach($this->collTurnosRelatedByUpdateBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collTurnoCambioEstadosRelatedByCreatedBy !== null) {
				foreach($this->collTurnoCambioEstadosRelatedByCreatedBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collTurnoCambioEstadosRelatedByUpdateBy !== null) {
				foreach($this->collTurnoCambioEstadosRelatedByUpdateBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collTurnoEstadosRelatedByCreatedBy !== null) {
				foreach($this->collTurnoEstadosRelatedByCreatedBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collTurnoEstadosRelatedByUpdateBy !== null) {
				foreach($this->collTurnoEstadosRelatedByUpdateBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collUsuariosRelatedByCreatedBy !== null) {
				foreach($this->collUsuariosRelatedByCreatedBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collUsuariosRelatedByUpdateBy !== null) {
				foreach($this->collUsuariosRelatedByUpdateBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collUsuarioEstudiosRelatedByUsuarioId !== null) {
				foreach($this->collUsuarioEstudiosRelatedByUsuarioId as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collUsuarioEstudiosRelatedByCreatedBy !== null) {
				foreach($this->collUsuarioEstudiosRelatedByCreatedBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collUsuarioEstudiosRelatedByUpdateBy !== null) {
				foreach($this->collUsuarioEstudiosRelatedByUpdateBy as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			$this->alreadyInSave = false;
		}
		return $affectedRows;
	} 
	
	protected $validationFailures = array();

	
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


												
			if ($this->aRol !== null) {
				if (!$this->aRol->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aRol->getValidationFailures());
				}
			}

			if ($this->aUsuarioRelatedByCreatedBy !== null) {
				if (!$this->aUsuarioRelatedByCreatedBy->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aUsuarioRelatedByCreatedBy->getValidationFailures());
				}
			}

			if ($this->aUsuarioRelatedByUpdateBy !== null) {
				if (!$this->aUsuarioRelatedByUpdateBy->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aUsuarioRelatedByUpdateBy->getValidationFailures());
				}
			}


			if (($retval = UsuarioPeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}


				if ($this->collCoberturasRelatedByCreatedBy !== null) {
					foreach($this->collCoberturasRelatedByCreatedBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collCoberturasRelatedByUpdateBy !== null) {
					foreach($this->collCoberturasRelatedByUpdateBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collCredencialsRelatedByCreatedBy !== null) {
					foreach($this->collCredencialsRelatedByCreatedBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collCredencialsRelatedByUpdateBy !== null) {
					foreach($this->collCredencialsRelatedByUpdateBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collDiasRelatedByCreatedBy !== null) {
					foreach($this->collDiasRelatedByCreatedBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collDiasRelatedByUpdateBy !== null) {
					foreach($this->collDiasRelatedByUpdateBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collEquiposRelatedByUsuarioId !== null) {
					foreach($this->collEquiposRelatedByUsuarioId as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collEquiposRelatedByEquipoId !== null) {
					foreach($this->collEquiposRelatedByEquipoId as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collEquiposRelatedByCreatedBy !== null) {
					foreach($this->collEquiposRelatedByCreatedBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collEquiposRelatedByUpdateBy !== null) {
					foreach($this->collEquiposRelatedByUpdateBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collEstudiosRelatedByCreatedBy !== null) {
					foreach($this->collEstudiosRelatedByCreatedBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collEstudiosRelatedByUpdateBy !== null) {
					foreach($this->collEstudiosRelatedByUpdateBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collHorariosRelatedByUsuarioId !== null) {
					foreach($this->collHorariosRelatedByUsuarioId as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collHorariosRelatedByCreatedBy !== null) {
					foreach($this->collHorariosRelatedByCreatedBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collHorariosRelatedByUpdateBy !== null) {
					foreach($this->collHorariosRelatedByUpdateBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collHorarioCambiosRelatedByUsuarioId !== null) {
					foreach($this->collHorarioCambiosRelatedByUsuarioId as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collHorarioCambiosRelatedByReemplazoId !== null) {
					foreach($this->collHorarioCambiosRelatedByReemplazoId as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collHorarioCambiosRelatedByCreatedBy !== null) {
					foreach($this->collHorarioCambiosRelatedByCreatedBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collHorarioCambiosRelatedByUpdateBy !== null) {
					foreach($this->collHorarioCambiosRelatedByUpdateBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collHorarioCambioTiposRelatedByCreatedBy !== null) {
					foreach($this->collHorarioCambioTiposRelatedByCreatedBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collHorarioCambioTiposRelatedByUpdateBy !== null) {
					foreach($this->collHorarioCambioTiposRelatedByUpdateBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collPacientesRelatedByCreatedBy !== null) {
					foreach($this->collPacientesRelatedByCreatedBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collPacientesRelatedByUpdateBy !== null) {
					foreach($this->collPacientesRelatedByUpdateBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collPlansRelatedByCreatedBy !== null) {
					foreach($this->collPlansRelatedByCreatedBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collPlansRelatedByUpdateBy !== null) {
					foreach($this->collPlansRelatedByUpdateBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collRolsRelatedByCreatedBy !== null) {
					foreach($this->collRolsRelatedByCreatedBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collRolsRelatedByUpdateBy !== null) {
					foreach($this->collRolsRelatedByUpdateBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collRolCredencialsRelatedByCreatedBy !== null) {
					foreach($this->collRolCredencialsRelatedByCreatedBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collRolCredencialsRelatedByUpdateBy !== null) {
					foreach($this->collRolCredencialsRelatedByUpdateBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collTurnosRelatedByMedicoId !== null) {
					foreach($this->collTurnosRelatedByMedicoId as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collTurnosRelatedByCreatedBy !== null) {
					foreach($this->collTurnosRelatedByCreatedBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collTurnosRelatedByUpdateBy !== null) {
					foreach($this->collTurnosRelatedByUpdateBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collTurnoCambioEstadosRelatedByCreatedBy !== null) {
					foreach($this->collTurnoCambioEstadosRelatedByCreatedBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collTurnoCambioEstadosRelatedByUpdateBy !== null) {
					foreach($this->collTurnoCambioEstadosRelatedByUpdateBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collTurnoEstadosRelatedByCreatedBy !== null) {
					foreach($this->collTurnoEstadosRelatedByCreatedBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collTurnoEstadosRelatedByUpdateBy !== null) {
					foreach($this->collTurnoEstadosRelatedByUpdateBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collUsuarioEstudiosRelatedByUsuarioId !== null) {
					foreach($this->collUsuarioEstudiosRelatedByUsuarioId as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collUsuarioEstudiosRelatedByCreatedBy !== null) {
					foreach($this->collUsuarioEstudiosRelatedByCreatedBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collUsuarioEstudiosRelatedByUpdateBy !== null) {
					foreach($this->collUsuarioEstudiosRelatedByUpdateBy as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}


			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = UsuarioPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getActivo();
				break;
			case 1:
				return $this->getRolId();
				break;
			case 2:
				return $this->getTitulo();
				break;
			case 3:
				return $this->getSuperadmin();
				break;
			case 4:
				return $this->getSobreturnos();
				break;
			case 5:
				return $this->getMn();
				break;
			case 6:
				return $this->getUsername();
				break;
			case 7:
				return $this->getPassword();
				break;
			case 8:
				return $this->getCelular();
				break;
			case 9:
				return $this->getEmail();
				break;
			case 10:
				return $this->getCreatedBy();
				break;
			case 11:
				return $this->getUpdateBy();
				break;
			case 12:
				return $this->getUpdatedFields();
				break;
			case 13:
				return $this->getId();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = UsuarioPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getActivo(),
			$keys[1] => $this->getRolId(),
			$keys[2] => $this->getTitulo(),
			$keys[3] => $this->getSuperadmin(),
			$keys[4] => $this->getSobreturnos(),
			$keys[5] => $this->getMn(),
			$keys[6] => $this->getUsername(),
			$keys[7] => $this->getPassword(),
			$keys[8] => $this->getCelular(),
			$keys[9] => $this->getEmail(),
			$keys[10] => $this->getCreatedBy(),
			$keys[11] => $this->getUpdateBy(),
			$keys[12] => $this->getUpdatedFields(),
			$keys[13] => $this->getId(),
		);
		return $result;
	}

	
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = UsuarioPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setActivo($value);
				break;
			case 1:
				$this->setRolId($value);
				break;
			case 2:
				$this->setTitulo($value);
				break;
			case 3:
				$this->setSuperadmin($value);
				break;
			case 4:
				$this->setSobreturnos($value);
				break;
			case 5:
				$this->setMn($value);
				break;
			case 6:
				$this->setUsername($value);
				break;
			case 7:
				$this->setPassword($value);
				break;
			case 8:
				$this->setCelular($value);
				break;
			case 9:
				$this->setEmail($value);
				break;
			case 10:
				$this->setCreatedBy($value);
				break;
			case 11:
				$this->setUpdateBy($value);
				break;
			case 12:
				$this->setUpdatedFields($value);
				break;
			case 13:
				$this->setId($value);
				break;
		} 	}

	
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = UsuarioPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setActivo($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setRolId($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setTitulo($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setSuperadmin($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setSobreturnos($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setMn($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setUsername($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setPassword($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setCelular($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setEmail($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setCreatedBy($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setUpdateBy($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setUpdatedFields($arr[$keys[12]]);
		if (array_key_exists($keys[13], $arr)) $this->setId($arr[$keys[13]]);
	}

	
	public function buildCriteria()
	{
		$criteria = new Criteria(UsuarioPeer::DATABASE_NAME);

		if ($this->isColumnModified(UsuarioPeer::ACTIVO)) $criteria->add(UsuarioPeer::ACTIVO, $this->activo);
		if ($this->isColumnModified(UsuarioPeer::ROL_ID)) $criteria->add(UsuarioPeer::ROL_ID, $this->rol_id);
		if ($this->isColumnModified(UsuarioPeer::TITULO)) $criteria->add(UsuarioPeer::TITULO, $this->titulo);
		if ($this->isColumnModified(UsuarioPeer::SUPERADMIN)) $criteria->add(UsuarioPeer::SUPERADMIN, $this->superadmin);
		if ($this->isColumnModified(UsuarioPeer::SOBRETURNOS)) $criteria->add(UsuarioPeer::SOBRETURNOS, $this->sobreturnos);
		if ($this->isColumnModified(UsuarioPeer::MN)) $criteria->add(UsuarioPeer::MN, $this->mn);
		if ($this->isColumnModified(UsuarioPeer::USERNAME)) $criteria->add(UsuarioPeer::USERNAME, $this->username);
		if ($this->isColumnModified(UsuarioPeer::PASSWORD)) $criteria->add(UsuarioPeer::PASSWORD, $this->password);
		if ($this->isColumnModified(UsuarioPeer::CELULAR)) $criteria->add(UsuarioPeer::CELULAR, $this->celular);
		if ($this->isColumnModified(UsuarioPeer::EMAIL)) $criteria->add(UsuarioPeer::EMAIL, $this->email);
		if ($this->isColumnModified(UsuarioPeer::CREATED_BY)) $criteria->add(UsuarioPeer::CREATED_BY, $this->created_by);
		if ($this->isColumnModified(UsuarioPeer::UPDATE_BY)) $criteria->add(UsuarioPeer::UPDATE_BY, $this->update_by);
		if ($this->isColumnModified(UsuarioPeer::UPDATED_FIELDS)) $criteria->add(UsuarioPeer::UPDATED_FIELDS, $this->updated_fields);
		if ($this->isColumnModified(UsuarioPeer::ID)) $criteria->add(UsuarioPeer::ID, $this->id);

		return $criteria;
	}

	
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(UsuarioPeer::DATABASE_NAME);

		$criteria->add(UsuarioPeer::ID, $this->id);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		return $this->getId();
	}

	
	public function setPrimaryKey($key)
	{
		$this->setId($key);
	}

	
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setActivo($this->activo);

		$copyObj->setRolId($this->rol_id);

		$copyObj->setTitulo($this->titulo);

		$copyObj->setSuperadmin($this->superadmin);

		$copyObj->setSobreturnos($this->sobreturnos);

		$copyObj->setMn($this->mn);

		$copyObj->setUsername($this->username);

		$copyObj->setPassword($this->password);

		$copyObj->setCelular($this->celular);

		$copyObj->setEmail($this->email);

		$copyObj->setCreatedBy($this->created_by);

		$copyObj->setUpdateBy($this->update_by);

		$copyObj->setUpdatedFields($this->updated_fields);


		if ($deepCopy) {
									$copyObj->setNew(false);

			foreach($this->getCoberturasRelatedByCreatedBy() as $relObj) {
				$copyObj->addCoberturaRelatedByCreatedBy($relObj->copy($deepCopy));
			}

			foreach($this->getCoberturasRelatedByUpdateBy() as $relObj) {
				$copyObj->addCoberturaRelatedByUpdateBy($relObj->copy($deepCopy));
			}

			foreach($this->getCredencialsRelatedByCreatedBy() as $relObj) {
				$copyObj->addCredencialRelatedByCreatedBy($relObj->copy($deepCopy));
			}

			foreach($this->getCredencialsRelatedByUpdateBy() as $relObj) {
				$copyObj->addCredencialRelatedByUpdateBy($relObj->copy($deepCopy));
			}

			foreach($this->getDiasRelatedByCreatedBy() as $relObj) {
				$copyObj->addDiaRelatedByCreatedBy($relObj->copy($deepCopy));
			}

			foreach($this->getDiasRelatedByUpdateBy() as $relObj) {
				$copyObj->addDiaRelatedByUpdateBy($relObj->copy($deepCopy));
			}

			foreach($this->getEquiposRelatedByUsuarioId() as $relObj) {
				$copyObj->addEquipoRelatedByUsuarioId($relObj->copy($deepCopy));
			}

			foreach($this->getEquiposRelatedByEquipoId() as $relObj) {
				$copyObj->addEquipoRelatedByEquipoId($relObj->copy($deepCopy));
			}

			foreach($this->getEquiposRelatedByCreatedBy() as $relObj) {
				$copyObj->addEquipoRelatedByCreatedBy($relObj->copy($deepCopy));
			}

			foreach($this->getEquiposRelatedByUpdateBy() as $relObj) {
				$copyObj->addEquipoRelatedByUpdateBy($relObj->copy($deepCopy));
			}

			foreach($this->getEstudiosRelatedByCreatedBy() as $relObj) {
				$copyObj->addEstudioRelatedByCreatedBy($relObj->copy($deepCopy));
			}

			foreach($this->getEstudiosRelatedByUpdateBy() as $relObj) {
				$copyObj->addEstudioRelatedByUpdateBy($relObj->copy($deepCopy));
			}

			foreach($this->getHorariosRelatedByUsuarioId() as $relObj) {
				$copyObj->addHorarioRelatedByUsuarioId($relObj->copy($deepCopy));
			}

			foreach($this->getHorariosRelatedByCreatedBy() as $relObj) {
				$copyObj->addHorarioRelatedByCreatedBy($relObj->copy($deepCopy));
			}

			foreach($this->getHorariosRelatedByUpdateBy() as $relObj) {
				$copyObj->addHorarioRelatedByUpdateBy($relObj->copy($deepCopy));
			}

			foreach($this->getHorarioCambiosRelatedByUsuarioId() as $relObj) {
				$copyObj->addHorarioCambioRelatedByUsuarioId($relObj->copy($deepCopy));
			}

			foreach($this->getHorarioCambiosRelatedByReemplazoId() as $relObj) {
				$copyObj->addHorarioCambioRelatedByReemplazoId($relObj->copy($deepCopy));
			}

			foreach($this->getHorarioCambiosRelatedByCreatedBy() as $relObj) {
				$copyObj->addHorarioCambioRelatedByCreatedBy($relObj->copy($deepCopy));
			}

			foreach($this->getHorarioCambiosRelatedByUpdateBy() as $relObj) {
				$copyObj->addHorarioCambioRelatedByUpdateBy($relObj->copy($deepCopy));
			}

			foreach($this->getHorarioCambioTiposRelatedByCreatedBy() as $relObj) {
				$copyObj->addHorarioCambioTipoRelatedByCreatedBy($relObj->copy($deepCopy));
			}

			foreach($this->getHorarioCambioTiposRelatedByUpdateBy() as $relObj) {
				$copyObj->addHorarioCambioTipoRelatedByUpdateBy($relObj->copy($deepCopy));
			}

			foreach($this->getPacientesRelatedByCreatedBy() as $relObj) {
				$copyObj->addPacienteRelatedByCreatedBy($relObj->copy($deepCopy));
			}

			foreach($this->getPacientesRelatedByUpdateBy() as $relObj) {
				$copyObj->addPacienteRelatedByUpdateBy($relObj->copy($deepCopy));
			}

			foreach($this->getPlansRelatedByCreatedBy() as $relObj) {
				$copyObj->addPlanRelatedByCreatedBy($relObj->copy($deepCopy));
			}

			foreach($this->getPlansRelatedByUpdateBy() as $relObj) {
				$copyObj->addPlanRelatedByUpdateBy($relObj->copy($deepCopy));
			}

			foreach($this->getRolsRelatedByCreatedBy() as $relObj) {
				$copyObj->addRolRelatedByCreatedBy($relObj->copy($deepCopy));
			}

			foreach($this->getRolsRelatedByUpdateBy() as $relObj) {
				$copyObj->addRolRelatedByUpdateBy($relObj->copy($deepCopy));
			}

			foreach($this->getRolCredencialsRelatedByCreatedBy() as $relObj) {
				$copyObj->addRolCredencialRelatedByCreatedBy($relObj->copy($deepCopy));
			}

			foreach($this->getRolCredencialsRelatedByUpdateBy() as $relObj) {
				$copyObj->addRolCredencialRelatedByUpdateBy($relObj->copy($deepCopy));
			}

			foreach($this->getTurnosRelatedByMedicoId() as $relObj) {
				$copyObj->addTurnoRelatedByMedicoId($relObj->copy($deepCopy));
			}

			foreach($this->getTurnosRelatedByCreatedBy() as $relObj) {
				$copyObj->addTurnoRelatedByCreatedBy($relObj->copy($deepCopy));
			}

			foreach($this->getTurnosRelatedByUpdateBy() as $relObj) {
				$copyObj->addTurnoRelatedByUpdateBy($relObj->copy($deepCopy));
			}

			foreach($this->getTurnoCambioEstadosRelatedByCreatedBy() as $relObj) {
				$copyObj->addTurnoCambioEstadoRelatedByCreatedBy($relObj->copy($deepCopy));
			}

			foreach($this->getTurnoCambioEstadosRelatedByUpdateBy() as $relObj) {
				$copyObj->addTurnoCambioEstadoRelatedByUpdateBy($relObj->copy($deepCopy));
			}

			foreach($this->getTurnoEstadosRelatedByCreatedBy() as $relObj) {
				$copyObj->addTurnoEstadoRelatedByCreatedBy($relObj->copy($deepCopy));
			}

			foreach($this->getTurnoEstadosRelatedByUpdateBy() as $relObj) {
				$copyObj->addTurnoEstadoRelatedByUpdateBy($relObj->copy($deepCopy));
			}

			foreach($this->getUsuariosRelatedByCreatedBy() as $relObj) {
				if($this->getPrimaryKey() === $relObj->getPrimaryKey()) {
						continue;
				}

				$copyObj->addUsuarioRelatedByCreatedBy($relObj->copy($deepCopy));
			}

			foreach($this->getUsuariosRelatedByUpdateBy() as $relObj) {
				if($this->getPrimaryKey() === $relObj->getPrimaryKey()) {
						continue;
				}

				$copyObj->addUsuarioRelatedByUpdateBy($relObj->copy($deepCopy));
			}

			foreach($this->getUsuarioEstudiosRelatedByUsuarioId() as $relObj) {
				$copyObj->addUsuarioEstudioRelatedByUsuarioId($relObj->copy($deepCopy));
			}

			foreach($this->getUsuarioEstudiosRelatedByCreatedBy() as $relObj) {
				$copyObj->addUsuarioEstudioRelatedByCreatedBy($relObj->copy($deepCopy));
			}

			foreach($this->getUsuarioEstudiosRelatedByUpdateBy() as $relObj) {
				$copyObj->addUsuarioEstudioRelatedByUpdateBy($relObj->copy($deepCopy));
			}

		} 

		$copyObj->setNew(true);

		$copyObj->setId(NULL); 
	}

	
	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new UsuarioPeer();
		}
		return self::$peer;
	}

	
	public function setRol($v)
	{


		if ($v === null) {
			$this->setRolId(NULL);
		} else {
			$this->setRolId($v->getId());
		}


		$this->aRol = $v;
	}


	
	public function getRol($con = null)
	{
		if ($this->aRol === null && ($this->rol_id !== null)) {
						include_once 'lib/model/om/BaseRolPeer.php';

			$this->aRol = RolPeer::retrieveByPK($this->rol_id, $con);

			
		}
		return $this->aRol;
	}

	
	public function setUsuarioRelatedByCreatedBy($v)
	{


		if ($v === null) {
			$this->setCreatedBy(NULL);
		} else {
			$this->setCreatedBy($v->getId());
		}


		$this->aUsuarioRelatedByCreatedBy = $v;
	}


	
	public function getUsuarioRelatedByCreatedBy($con = null)
	{
		if ($this->aUsuarioRelatedByCreatedBy === null && ($this->created_by !== null)) {
						include_once 'lib/model/om/BaseUsuarioPeer.php';

			$this->aUsuarioRelatedByCreatedBy = UsuarioPeer::retrieveByPK($this->created_by, $con);

			
		}
		return $this->aUsuarioRelatedByCreatedBy;
	}

	
	public function setUsuarioRelatedByUpdateBy($v)
	{


		if ($v === null) {
			$this->setUpdateBy(NULL);
		} else {
			$this->setUpdateBy($v->getId());
		}


		$this->aUsuarioRelatedByUpdateBy = $v;
	}


	
	public function getUsuarioRelatedByUpdateBy($con = null)
	{
		if ($this->aUsuarioRelatedByUpdateBy === null && ($this->update_by !== null)) {
						include_once 'lib/model/om/BaseUsuarioPeer.php';

			$this->aUsuarioRelatedByUpdateBy = UsuarioPeer::retrieveByPK($this->update_by, $con);

			
		}
		return $this->aUsuarioRelatedByUpdateBy;
	}

	
	public function initCoberturasRelatedByCreatedBy()
	{
		if ($this->collCoberturasRelatedByCreatedBy === null) {
			$this->collCoberturasRelatedByCreatedBy = array();
		}
	}

	
	public function getCoberturasRelatedByCreatedBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseCoberturaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collCoberturasRelatedByCreatedBy === null) {
			if ($this->isNew()) {
			   $this->collCoberturasRelatedByCreatedBy = array();
			} else {

				$criteria->add(CoberturaPeer::CREATED_BY, $this->getId());

				CoberturaPeer::addSelectColumns($criteria);
				$this->collCoberturasRelatedByCreatedBy = CoberturaPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(CoberturaPeer::CREATED_BY, $this->getId());

				CoberturaPeer::addSelectColumns($criteria);
				if (!isset($this->lastCoberturaRelatedByCreatedByCriteria) || !$this->lastCoberturaRelatedByCreatedByCriteria->equals($criteria)) {
					$this->collCoberturasRelatedByCreatedBy = CoberturaPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastCoberturaRelatedByCreatedByCriteria = $criteria;
		return $this->collCoberturasRelatedByCreatedBy;
	}

	
	public function countCoberturasRelatedByCreatedBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseCoberturaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(CoberturaPeer::CREATED_BY, $this->getId());

		return CoberturaPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addCoberturaRelatedByCreatedBy(Cobertura $l)
	{
		$this->collCoberturasRelatedByCreatedBy[] = $l;
		$l->setUsuarioRelatedByCreatedBy($this);
	}

	
	public function initCoberturasRelatedByUpdateBy()
	{
		if ($this->collCoberturasRelatedByUpdateBy === null) {
			$this->collCoberturasRelatedByUpdateBy = array();
		}
	}

	
	public function getCoberturasRelatedByUpdateBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseCoberturaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collCoberturasRelatedByUpdateBy === null) {
			if ($this->isNew()) {
			   $this->collCoberturasRelatedByUpdateBy = array();
			} else {

				$criteria->add(CoberturaPeer::UPDATE_BY, $this->getId());

				CoberturaPeer::addSelectColumns($criteria);
				$this->collCoberturasRelatedByUpdateBy = CoberturaPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(CoberturaPeer::UPDATE_BY, $this->getId());

				CoberturaPeer::addSelectColumns($criteria);
				if (!isset($this->lastCoberturaRelatedByUpdateByCriteria) || !$this->lastCoberturaRelatedByUpdateByCriteria->equals($criteria)) {
					$this->collCoberturasRelatedByUpdateBy = CoberturaPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastCoberturaRelatedByUpdateByCriteria = $criteria;
		return $this->collCoberturasRelatedByUpdateBy;
	}

	
	public function countCoberturasRelatedByUpdateBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseCoberturaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(CoberturaPeer::UPDATE_BY, $this->getId());

		return CoberturaPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addCoberturaRelatedByUpdateBy(Cobertura $l)
	{
		$this->collCoberturasRelatedByUpdateBy[] = $l;
		$l->setUsuarioRelatedByUpdateBy($this);
	}

	
	public function initCredencialsRelatedByCreatedBy()
	{
		if ($this->collCredencialsRelatedByCreatedBy === null) {
			$this->collCredencialsRelatedByCreatedBy = array();
		}
	}

	
	public function getCredencialsRelatedByCreatedBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseCredencialPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collCredencialsRelatedByCreatedBy === null) {
			if ($this->isNew()) {
			   $this->collCredencialsRelatedByCreatedBy = array();
			} else {

				$criteria->add(CredencialPeer::CREATED_BY, $this->getId());

				CredencialPeer::addSelectColumns($criteria);
				$this->collCredencialsRelatedByCreatedBy = CredencialPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(CredencialPeer::CREATED_BY, $this->getId());

				CredencialPeer::addSelectColumns($criteria);
				if (!isset($this->lastCredencialRelatedByCreatedByCriteria) || !$this->lastCredencialRelatedByCreatedByCriteria->equals($criteria)) {
					$this->collCredencialsRelatedByCreatedBy = CredencialPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastCredencialRelatedByCreatedByCriteria = $criteria;
		return $this->collCredencialsRelatedByCreatedBy;
	}

	
	public function countCredencialsRelatedByCreatedBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseCredencialPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(CredencialPeer::CREATED_BY, $this->getId());

		return CredencialPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addCredencialRelatedByCreatedBy(Credencial $l)
	{
		$this->collCredencialsRelatedByCreatedBy[] = $l;
		$l->setUsuarioRelatedByCreatedBy($this);
	}

	
	public function initCredencialsRelatedByUpdateBy()
	{
		if ($this->collCredencialsRelatedByUpdateBy === null) {
			$this->collCredencialsRelatedByUpdateBy = array();
		}
	}

	
	public function getCredencialsRelatedByUpdateBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseCredencialPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collCredencialsRelatedByUpdateBy === null) {
			if ($this->isNew()) {
			   $this->collCredencialsRelatedByUpdateBy = array();
			} else {

				$criteria->add(CredencialPeer::UPDATE_BY, $this->getId());

				CredencialPeer::addSelectColumns($criteria);
				$this->collCredencialsRelatedByUpdateBy = CredencialPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(CredencialPeer::UPDATE_BY, $this->getId());

				CredencialPeer::addSelectColumns($criteria);
				if (!isset($this->lastCredencialRelatedByUpdateByCriteria) || !$this->lastCredencialRelatedByUpdateByCriteria->equals($criteria)) {
					$this->collCredencialsRelatedByUpdateBy = CredencialPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastCredencialRelatedByUpdateByCriteria = $criteria;
		return $this->collCredencialsRelatedByUpdateBy;
	}

	
	public function countCredencialsRelatedByUpdateBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseCredencialPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(CredencialPeer::UPDATE_BY, $this->getId());

		return CredencialPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addCredencialRelatedByUpdateBy(Credencial $l)
	{
		$this->collCredencialsRelatedByUpdateBy[] = $l;
		$l->setUsuarioRelatedByUpdateBy($this);
	}

	
	public function initDiasRelatedByCreatedBy()
	{
		if ($this->collDiasRelatedByCreatedBy === null) {
			$this->collDiasRelatedByCreatedBy = array();
		}
	}

	
	public function getDiasRelatedByCreatedBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseDiaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collDiasRelatedByCreatedBy === null) {
			if ($this->isNew()) {
			   $this->collDiasRelatedByCreatedBy = array();
			} else {

				$criteria->add(DiaPeer::CREATED_BY, $this->getId());

				DiaPeer::addSelectColumns($criteria);
				$this->collDiasRelatedByCreatedBy = DiaPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(DiaPeer::CREATED_BY, $this->getId());

				DiaPeer::addSelectColumns($criteria);
				if (!isset($this->lastDiaRelatedByCreatedByCriteria) || !$this->lastDiaRelatedByCreatedByCriteria->equals($criteria)) {
					$this->collDiasRelatedByCreatedBy = DiaPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastDiaRelatedByCreatedByCriteria = $criteria;
		return $this->collDiasRelatedByCreatedBy;
	}

	
	public function countDiasRelatedByCreatedBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseDiaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(DiaPeer::CREATED_BY, $this->getId());

		return DiaPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addDiaRelatedByCreatedBy(Dia $l)
	{
		$this->collDiasRelatedByCreatedBy[] = $l;
		$l->setUsuarioRelatedByCreatedBy($this);
	}

	
	public function initDiasRelatedByUpdateBy()
	{
		if ($this->collDiasRelatedByUpdateBy === null) {
			$this->collDiasRelatedByUpdateBy = array();
		}
	}

	
	public function getDiasRelatedByUpdateBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseDiaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collDiasRelatedByUpdateBy === null) {
			if ($this->isNew()) {
			   $this->collDiasRelatedByUpdateBy = array();
			} else {

				$criteria->add(DiaPeer::UPDATE_BY, $this->getId());

				DiaPeer::addSelectColumns($criteria);
				$this->collDiasRelatedByUpdateBy = DiaPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(DiaPeer::UPDATE_BY, $this->getId());

				DiaPeer::addSelectColumns($criteria);
				if (!isset($this->lastDiaRelatedByUpdateByCriteria) || !$this->lastDiaRelatedByUpdateByCriteria->equals($criteria)) {
					$this->collDiasRelatedByUpdateBy = DiaPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastDiaRelatedByUpdateByCriteria = $criteria;
		return $this->collDiasRelatedByUpdateBy;
	}

	
	public function countDiasRelatedByUpdateBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseDiaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(DiaPeer::UPDATE_BY, $this->getId());

		return DiaPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addDiaRelatedByUpdateBy(Dia $l)
	{
		$this->collDiasRelatedByUpdateBy[] = $l;
		$l->setUsuarioRelatedByUpdateBy($this);
	}

	
	public function initEquiposRelatedByUsuarioId()
	{
		if ($this->collEquiposRelatedByUsuarioId === null) {
			$this->collEquiposRelatedByUsuarioId = array();
		}
	}

	
	public function getEquiposRelatedByUsuarioId($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseEquipoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collEquiposRelatedByUsuarioId === null) {
			if ($this->isNew()) {
			   $this->collEquiposRelatedByUsuarioId = array();
			} else {

				$criteria->add(EquipoPeer::USUARIO_ID, $this->getId());

				EquipoPeer::addSelectColumns($criteria);
				$this->collEquiposRelatedByUsuarioId = EquipoPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(EquipoPeer::USUARIO_ID, $this->getId());

				EquipoPeer::addSelectColumns($criteria);
				if (!isset($this->lastEquipoRelatedByUsuarioIdCriteria) || !$this->lastEquipoRelatedByUsuarioIdCriteria->equals($criteria)) {
					$this->collEquiposRelatedByUsuarioId = EquipoPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastEquipoRelatedByUsuarioIdCriteria = $criteria;
		return $this->collEquiposRelatedByUsuarioId;
	}

	
	public function countEquiposRelatedByUsuarioId($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseEquipoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(EquipoPeer::USUARIO_ID, $this->getId());

		return EquipoPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addEquipoRelatedByUsuarioId(Equipo $l)
	{
		$this->collEquiposRelatedByUsuarioId[] = $l;
		$l->setUsuarioRelatedByUsuarioId($this);
	}

	
	public function initEquiposRelatedByEquipoId()
	{
		if ($this->collEquiposRelatedByEquipoId === null) {
			$this->collEquiposRelatedByEquipoId = array();
		}
	}

	
	public function getEquiposRelatedByEquipoId($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseEquipoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collEquiposRelatedByEquipoId === null) {
			if ($this->isNew()) {
			   $this->collEquiposRelatedByEquipoId = array();
			} else {

				$criteria->add(EquipoPeer::EQUIPO_ID, $this->getId());

				EquipoPeer::addSelectColumns($criteria);
				$this->collEquiposRelatedByEquipoId = EquipoPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(EquipoPeer::EQUIPO_ID, $this->getId());

				EquipoPeer::addSelectColumns($criteria);
				if (!isset($this->lastEquipoRelatedByEquipoIdCriteria) || !$this->lastEquipoRelatedByEquipoIdCriteria->equals($criteria)) {
					$this->collEquiposRelatedByEquipoId = EquipoPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastEquipoRelatedByEquipoIdCriteria = $criteria;
		return $this->collEquiposRelatedByEquipoId;
	}

	
	public function countEquiposRelatedByEquipoId($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseEquipoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(EquipoPeer::EQUIPO_ID, $this->getId());

		return EquipoPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addEquipoRelatedByEquipoId(Equipo $l)
	{
		$this->collEquiposRelatedByEquipoId[] = $l;
		$l->setUsuarioRelatedByEquipoId($this);
	}

	
	public function initEquiposRelatedByCreatedBy()
	{
		if ($this->collEquiposRelatedByCreatedBy === null) {
			$this->collEquiposRelatedByCreatedBy = array();
		}
	}

	
	public function getEquiposRelatedByCreatedBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseEquipoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collEquiposRelatedByCreatedBy === null) {
			if ($this->isNew()) {
			   $this->collEquiposRelatedByCreatedBy = array();
			} else {

				$criteria->add(EquipoPeer::CREATED_BY, $this->getId());

				EquipoPeer::addSelectColumns($criteria);
				$this->collEquiposRelatedByCreatedBy = EquipoPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(EquipoPeer::CREATED_BY, $this->getId());

				EquipoPeer::addSelectColumns($criteria);
				if (!isset($this->lastEquipoRelatedByCreatedByCriteria) || !$this->lastEquipoRelatedByCreatedByCriteria->equals($criteria)) {
					$this->collEquiposRelatedByCreatedBy = EquipoPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastEquipoRelatedByCreatedByCriteria = $criteria;
		return $this->collEquiposRelatedByCreatedBy;
	}

	
	public function countEquiposRelatedByCreatedBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseEquipoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(EquipoPeer::CREATED_BY, $this->getId());

		return EquipoPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addEquipoRelatedByCreatedBy(Equipo $l)
	{
		$this->collEquiposRelatedByCreatedBy[] = $l;
		$l->setUsuarioRelatedByCreatedBy($this);
	}

	
	public function initEquiposRelatedByUpdateBy()
	{
		if ($this->collEquiposRelatedByUpdateBy === null) {
			$this->collEquiposRelatedByUpdateBy = array();
		}
	}

	
	public function getEquiposRelatedByUpdateBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseEquipoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collEquiposRelatedByUpdateBy === null) {
			if ($this->isNew()) {
			   $this->collEquiposRelatedByUpdateBy = array();
			} else {

				$criteria->add(EquipoPeer::UPDATE_BY, $this->getId());

				EquipoPeer::addSelectColumns($criteria);
				$this->collEquiposRelatedByUpdateBy = EquipoPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(EquipoPeer::UPDATE_BY, $this->getId());

				EquipoPeer::addSelectColumns($criteria);
				if (!isset($this->lastEquipoRelatedByUpdateByCriteria) || !$this->lastEquipoRelatedByUpdateByCriteria->equals($criteria)) {
					$this->collEquiposRelatedByUpdateBy = EquipoPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastEquipoRelatedByUpdateByCriteria = $criteria;
		return $this->collEquiposRelatedByUpdateBy;
	}

	
	public function countEquiposRelatedByUpdateBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseEquipoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(EquipoPeer::UPDATE_BY, $this->getId());

		return EquipoPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addEquipoRelatedByUpdateBy(Equipo $l)
	{
		$this->collEquiposRelatedByUpdateBy[] = $l;
		$l->setUsuarioRelatedByUpdateBy($this);
	}

	
	public function initEstudiosRelatedByCreatedBy()
	{
		if ($this->collEstudiosRelatedByCreatedBy === null) {
			$this->collEstudiosRelatedByCreatedBy = array();
		}
	}

	
	public function getEstudiosRelatedByCreatedBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseEstudioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collEstudiosRelatedByCreatedBy === null) {
			if ($this->isNew()) {
			   $this->collEstudiosRelatedByCreatedBy = array();
			} else {

				$criteria->add(EstudioPeer::CREATED_BY, $this->getId());

				EstudioPeer::addSelectColumns($criteria);
				$this->collEstudiosRelatedByCreatedBy = EstudioPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(EstudioPeer::CREATED_BY, $this->getId());

				EstudioPeer::addSelectColumns($criteria);
				if (!isset($this->lastEstudioRelatedByCreatedByCriteria) || !$this->lastEstudioRelatedByCreatedByCriteria->equals($criteria)) {
					$this->collEstudiosRelatedByCreatedBy = EstudioPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastEstudioRelatedByCreatedByCriteria = $criteria;
		return $this->collEstudiosRelatedByCreatedBy;
	}

	
	public function countEstudiosRelatedByCreatedBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseEstudioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(EstudioPeer::CREATED_BY, $this->getId());

		return EstudioPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addEstudioRelatedByCreatedBy(Estudio $l)
	{
		$this->collEstudiosRelatedByCreatedBy[] = $l;
		$l->setUsuarioRelatedByCreatedBy($this);
	}

	
	public function initEstudiosRelatedByUpdateBy()
	{
		if ($this->collEstudiosRelatedByUpdateBy === null) {
			$this->collEstudiosRelatedByUpdateBy = array();
		}
	}

	
	public function getEstudiosRelatedByUpdateBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseEstudioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collEstudiosRelatedByUpdateBy === null) {
			if ($this->isNew()) {
			   $this->collEstudiosRelatedByUpdateBy = array();
			} else {

				$criteria->add(EstudioPeer::UPDATE_BY, $this->getId());

				EstudioPeer::addSelectColumns($criteria);
				$this->collEstudiosRelatedByUpdateBy = EstudioPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(EstudioPeer::UPDATE_BY, $this->getId());

				EstudioPeer::addSelectColumns($criteria);
				if (!isset($this->lastEstudioRelatedByUpdateByCriteria) || !$this->lastEstudioRelatedByUpdateByCriteria->equals($criteria)) {
					$this->collEstudiosRelatedByUpdateBy = EstudioPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastEstudioRelatedByUpdateByCriteria = $criteria;
		return $this->collEstudiosRelatedByUpdateBy;
	}

	
	public function countEstudiosRelatedByUpdateBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseEstudioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(EstudioPeer::UPDATE_BY, $this->getId());

		return EstudioPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addEstudioRelatedByUpdateBy(Estudio $l)
	{
		$this->collEstudiosRelatedByUpdateBy[] = $l;
		$l->setUsuarioRelatedByUpdateBy($this);
	}

	
	public function initHorariosRelatedByUsuarioId()
	{
		if ($this->collHorariosRelatedByUsuarioId === null) {
			$this->collHorariosRelatedByUsuarioId = array();
		}
	}

	
	public function getHorariosRelatedByUsuarioId($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorariosRelatedByUsuarioId === null) {
			if ($this->isNew()) {
			   $this->collHorariosRelatedByUsuarioId = array();
			} else {

				$criteria->add(HorarioPeer::USUARIO_ID, $this->getId());

				HorarioPeer::addSelectColumns($criteria);
				$this->collHorariosRelatedByUsuarioId = HorarioPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(HorarioPeer::USUARIO_ID, $this->getId());

				HorarioPeer::addSelectColumns($criteria);
				if (!isset($this->lastHorarioRelatedByUsuarioIdCriteria) || !$this->lastHorarioRelatedByUsuarioIdCriteria->equals($criteria)) {
					$this->collHorariosRelatedByUsuarioId = HorarioPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastHorarioRelatedByUsuarioIdCriteria = $criteria;
		return $this->collHorariosRelatedByUsuarioId;
	}

	
	public function countHorariosRelatedByUsuarioId($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(HorarioPeer::USUARIO_ID, $this->getId());

		return HorarioPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addHorarioRelatedByUsuarioId(Horario $l)
	{
		$this->collHorariosRelatedByUsuarioId[] = $l;
		$l->setUsuarioRelatedByUsuarioId($this);
	}


	
	public function getHorariosRelatedByUsuarioIdJoinDia($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorariosRelatedByUsuarioId === null) {
			if ($this->isNew()) {
				$this->collHorariosRelatedByUsuarioId = array();
			} else {

				$criteria->add(HorarioPeer::USUARIO_ID, $this->getId());

				$this->collHorariosRelatedByUsuarioId = HorarioPeer::doSelectJoinDia($criteria, $con);
			}
		} else {
									
			$criteria->add(HorarioPeer::USUARIO_ID, $this->getId());

			if (!isset($this->lastHorarioRelatedByUsuarioIdCriteria) || !$this->lastHorarioRelatedByUsuarioIdCriteria->equals($criteria)) {
				$this->collHorariosRelatedByUsuarioId = HorarioPeer::doSelectJoinDia($criteria, $con);
			}
		}
		$this->lastHorarioRelatedByUsuarioIdCriteria = $criteria;

		return $this->collHorariosRelatedByUsuarioId;
	}

	
	public function initHorariosRelatedByCreatedBy()
	{
		if ($this->collHorariosRelatedByCreatedBy === null) {
			$this->collHorariosRelatedByCreatedBy = array();
		}
	}

	
	public function getHorariosRelatedByCreatedBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorariosRelatedByCreatedBy === null) {
			if ($this->isNew()) {
			   $this->collHorariosRelatedByCreatedBy = array();
			} else {

				$criteria->add(HorarioPeer::CREATED_BY, $this->getId());

				HorarioPeer::addSelectColumns($criteria);
				$this->collHorariosRelatedByCreatedBy = HorarioPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(HorarioPeer::CREATED_BY, $this->getId());

				HorarioPeer::addSelectColumns($criteria);
				if (!isset($this->lastHorarioRelatedByCreatedByCriteria) || !$this->lastHorarioRelatedByCreatedByCriteria->equals($criteria)) {
					$this->collHorariosRelatedByCreatedBy = HorarioPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastHorarioRelatedByCreatedByCriteria = $criteria;
		return $this->collHorariosRelatedByCreatedBy;
	}

	
	public function countHorariosRelatedByCreatedBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(HorarioPeer::CREATED_BY, $this->getId());

		return HorarioPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addHorarioRelatedByCreatedBy(Horario $l)
	{
		$this->collHorariosRelatedByCreatedBy[] = $l;
		$l->setUsuarioRelatedByCreatedBy($this);
	}


	
	public function getHorariosRelatedByCreatedByJoinDia($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorariosRelatedByCreatedBy === null) {
			if ($this->isNew()) {
				$this->collHorariosRelatedByCreatedBy = array();
			} else {

				$criteria->add(HorarioPeer::CREATED_BY, $this->getId());

				$this->collHorariosRelatedByCreatedBy = HorarioPeer::doSelectJoinDia($criteria, $con);
			}
		} else {
									
			$criteria->add(HorarioPeer::CREATED_BY, $this->getId());

			if (!isset($this->lastHorarioRelatedByCreatedByCriteria) || !$this->lastHorarioRelatedByCreatedByCriteria->equals($criteria)) {
				$this->collHorariosRelatedByCreatedBy = HorarioPeer::doSelectJoinDia($criteria, $con);
			}
		}
		$this->lastHorarioRelatedByCreatedByCriteria = $criteria;

		return $this->collHorariosRelatedByCreatedBy;
	}

	
	public function initHorariosRelatedByUpdateBy()
	{
		if ($this->collHorariosRelatedByUpdateBy === null) {
			$this->collHorariosRelatedByUpdateBy = array();
		}
	}

	
	public function getHorariosRelatedByUpdateBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorariosRelatedByUpdateBy === null) {
			if ($this->isNew()) {
			   $this->collHorariosRelatedByUpdateBy = array();
			} else {

				$criteria->add(HorarioPeer::UPDATE_BY, $this->getId());

				HorarioPeer::addSelectColumns($criteria);
				$this->collHorariosRelatedByUpdateBy = HorarioPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(HorarioPeer::UPDATE_BY, $this->getId());

				HorarioPeer::addSelectColumns($criteria);
				if (!isset($this->lastHorarioRelatedByUpdateByCriteria) || !$this->lastHorarioRelatedByUpdateByCriteria->equals($criteria)) {
					$this->collHorariosRelatedByUpdateBy = HorarioPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastHorarioRelatedByUpdateByCriteria = $criteria;
		return $this->collHorariosRelatedByUpdateBy;
	}

	
	public function countHorariosRelatedByUpdateBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(HorarioPeer::UPDATE_BY, $this->getId());

		return HorarioPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addHorarioRelatedByUpdateBy(Horario $l)
	{
		$this->collHorariosRelatedByUpdateBy[] = $l;
		$l->setUsuarioRelatedByUpdateBy($this);
	}


	
	public function getHorariosRelatedByUpdateByJoinDia($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorariosRelatedByUpdateBy === null) {
			if ($this->isNew()) {
				$this->collHorariosRelatedByUpdateBy = array();
			} else {

				$criteria->add(HorarioPeer::UPDATE_BY, $this->getId());

				$this->collHorariosRelatedByUpdateBy = HorarioPeer::doSelectJoinDia($criteria, $con);
			}
		} else {
									
			$criteria->add(HorarioPeer::UPDATE_BY, $this->getId());

			if (!isset($this->lastHorarioRelatedByUpdateByCriteria) || !$this->lastHorarioRelatedByUpdateByCriteria->equals($criteria)) {
				$this->collHorariosRelatedByUpdateBy = HorarioPeer::doSelectJoinDia($criteria, $con);
			}
		}
		$this->lastHorarioRelatedByUpdateByCriteria = $criteria;

		return $this->collHorariosRelatedByUpdateBy;
	}

	
	public function initHorarioCambiosRelatedByUsuarioId()
	{
		if ($this->collHorarioCambiosRelatedByUsuarioId === null) {
			$this->collHorarioCambiosRelatedByUsuarioId = array();
		}
	}

	
	public function getHorarioCambiosRelatedByUsuarioId($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorarioCambiosRelatedByUsuarioId === null) {
			if ($this->isNew()) {
			   $this->collHorarioCambiosRelatedByUsuarioId = array();
			} else {

				$criteria->add(HorarioCambioPeer::USUARIO_ID, $this->getId());

				HorarioCambioPeer::addSelectColumns($criteria);
				$this->collHorarioCambiosRelatedByUsuarioId = HorarioCambioPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(HorarioCambioPeer::USUARIO_ID, $this->getId());

				HorarioCambioPeer::addSelectColumns($criteria);
				if (!isset($this->lastHorarioCambioRelatedByUsuarioIdCriteria) || !$this->lastHorarioCambioRelatedByUsuarioIdCriteria->equals($criteria)) {
					$this->collHorarioCambiosRelatedByUsuarioId = HorarioCambioPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastHorarioCambioRelatedByUsuarioIdCriteria = $criteria;
		return $this->collHorarioCambiosRelatedByUsuarioId;
	}

	
	public function countHorarioCambiosRelatedByUsuarioId($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(HorarioCambioPeer::USUARIO_ID, $this->getId());

		return HorarioCambioPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addHorarioCambioRelatedByUsuarioId(HorarioCambio $l)
	{
		$this->collHorarioCambiosRelatedByUsuarioId[] = $l;
		$l->setUsuarioRelatedByUsuarioId($this);
	}


	
	public function getHorarioCambiosRelatedByUsuarioIdJoinDia($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorarioCambiosRelatedByUsuarioId === null) {
			if ($this->isNew()) {
				$this->collHorarioCambiosRelatedByUsuarioId = array();
			} else {

				$criteria->add(HorarioCambioPeer::USUARIO_ID, $this->getId());

				$this->collHorarioCambiosRelatedByUsuarioId = HorarioCambioPeer::doSelectJoinDia($criteria, $con);
			}
		} else {
									
			$criteria->add(HorarioCambioPeer::USUARIO_ID, $this->getId());

			if (!isset($this->lastHorarioCambioRelatedByUsuarioIdCriteria) || !$this->lastHorarioCambioRelatedByUsuarioIdCriteria->equals($criteria)) {
				$this->collHorarioCambiosRelatedByUsuarioId = HorarioCambioPeer::doSelectJoinDia($criteria, $con);
			}
		}
		$this->lastHorarioCambioRelatedByUsuarioIdCriteria = $criteria;

		return $this->collHorarioCambiosRelatedByUsuarioId;
	}


	
	public function getHorarioCambiosRelatedByUsuarioIdJoinHorarioCambioTipo($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorarioCambiosRelatedByUsuarioId === null) {
			if ($this->isNew()) {
				$this->collHorarioCambiosRelatedByUsuarioId = array();
			} else {

				$criteria->add(HorarioCambioPeer::USUARIO_ID, $this->getId());

				$this->collHorarioCambiosRelatedByUsuarioId = HorarioCambioPeer::doSelectJoinHorarioCambioTipo($criteria, $con);
			}
		} else {
									
			$criteria->add(HorarioCambioPeer::USUARIO_ID, $this->getId());

			if (!isset($this->lastHorarioCambioRelatedByUsuarioIdCriteria) || !$this->lastHorarioCambioRelatedByUsuarioIdCriteria->equals($criteria)) {
				$this->collHorarioCambiosRelatedByUsuarioId = HorarioCambioPeer::doSelectJoinHorarioCambioTipo($criteria, $con);
			}
		}
		$this->lastHorarioCambioRelatedByUsuarioIdCriteria = $criteria;

		return $this->collHorarioCambiosRelatedByUsuarioId;
	}

	
	public function initHorarioCambiosRelatedByReemplazoId()
	{
		if ($this->collHorarioCambiosRelatedByReemplazoId === null) {
			$this->collHorarioCambiosRelatedByReemplazoId = array();
		}
	}

	
	public function getHorarioCambiosRelatedByReemplazoId($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorarioCambiosRelatedByReemplazoId === null) {
			if ($this->isNew()) {
			   $this->collHorarioCambiosRelatedByReemplazoId = array();
			} else {

				$criteria->add(HorarioCambioPeer::REEMPLAZO_ID, $this->getId());

				HorarioCambioPeer::addSelectColumns($criteria);
				$this->collHorarioCambiosRelatedByReemplazoId = HorarioCambioPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(HorarioCambioPeer::REEMPLAZO_ID, $this->getId());

				HorarioCambioPeer::addSelectColumns($criteria);
				if (!isset($this->lastHorarioCambioRelatedByReemplazoIdCriteria) || !$this->lastHorarioCambioRelatedByReemplazoIdCriteria->equals($criteria)) {
					$this->collHorarioCambiosRelatedByReemplazoId = HorarioCambioPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastHorarioCambioRelatedByReemplazoIdCriteria = $criteria;
		return $this->collHorarioCambiosRelatedByReemplazoId;
	}

	
	public function countHorarioCambiosRelatedByReemplazoId($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(HorarioCambioPeer::REEMPLAZO_ID, $this->getId());

		return HorarioCambioPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addHorarioCambioRelatedByReemplazoId(HorarioCambio $l)
	{
		$this->collHorarioCambiosRelatedByReemplazoId[] = $l;
		$l->setUsuarioRelatedByReemplazoId($this);
	}


	
	public function getHorarioCambiosRelatedByReemplazoIdJoinDia($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorarioCambiosRelatedByReemplazoId === null) {
			if ($this->isNew()) {
				$this->collHorarioCambiosRelatedByReemplazoId = array();
			} else {

				$criteria->add(HorarioCambioPeer::REEMPLAZO_ID, $this->getId());

				$this->collHorarioCambiosRelatedByReemplazoId = HorarioCambioPeer::doSelectJoinDia($criteria, $con);
			}
		} else {
									
			$criteria->add(HorarioCambioPeer::REEMPLAZO_ID, $this->getId());

			if (!isset($this->lastHorarioCambioRelatedByReemplazoIdCriteria) || !$this->lastHorarioCambioRelatedByReemplazoIdCriteria->equals($criteria)) {
				$this->collHorarioCambiosRelatedByReemplazoId = HorarioCambioPeer::doSelectJoinDia($criteria, $con);
			}
		}
		$this->lastHorarioCambioRelatedByReemplazoIdCriteria = $criteria;

		return $this->collHorarioCambiosRelatedByReemplazoId;
	}


	
	public function getHorarioCambiosRelatedByReemplazoIdJoinHorarioCambioTipo($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorarioCambiosRelatedByReemplazoId === null) {
			if ($this->isNew()) {
				$this->collHorarioCambiosRelatedByReemplazoId = array();
			} else {

				$criteria->add(HorarioCambioPeer::REEMPLAZO_ID, $this->getId());

				$this->collHorarioCambiosRelatedByReemplazoId = HorarioCambioPeer::doSelectJoinHorarioCambioTipo($criteria, $con);
			}
		} else {
									
			$criteria->add(HorarioCambioPeer::REEMPLAZO_ID, $this->getId());

			if (!isset($this->lastHorarioCambioRelatedByReemplazoIdCriteria) || !$this->lastHorarioCambioRelatedByReemplazoIdCriteria->equals($criteria)) {
				$this->collHorarioCambiosRelatedByReemplazoId = HorarioCambioPeer::doSelectJoinHorarioCambioTipo($criteria, $con);
			}
		}
		$this->lastHorarioCambioRelatedByReemplazoIdCriteria = $criteria;

		return $this->collHorarioCambiosRelatedByReemplazoId;
	}

	
	public function initHorarioCambiosRelatedByCreatedBy()
	{
		if ($this->collHorarioCambiosRelatedByCreatedBy === null) {
			$this->collHorarioCambiosRelatedByCreatedBy = array();
		}
	}

	
	public function getHorarioCambiosRelatedByCreatedBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorarioCambiosRelatedByCreatedBy === null) {
			if ($this->isNew()) {
			   $this->collHorarioCambiosRelatedByCreatedBy = array();
			} else {

				$criteria->add(HorarioCambioPeer::CREATED_BY, $this->getId());

				HorarioCambioPeer::addSelectColumns($criteria);
				$this->collHorarioCambiosRelatedByCreatedBy = HorarioCambioPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(HorarioCambioPeer::CREATED_BY, $this->getId());

				HorarioCambioPeer::addSelectColumns($criteria);
				if (!isset($this->lastHorarioCambioRelatedByCreatedByCriteria) || !$this->lastHorarioCambioRelatedByCreatedByCriteria->equals($criteria)) {
					$this->collHorarioCambiosRelatedByCreatedBy = HorarioCambioPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastHorarioCambioRelatedByCreatedByCriteria = $criteria;
		return $this->collHorarioCambiosRelatedByCreatedBy;
	}

	
	public function countHorarioCambiosRelatedByCreatedBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(HorarioCambioPeer::CREATED_BY, $this->getId());

		return HorarioCambioPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addHorarioCambioRelatedByCreatedBy(HorarioCambio $l)
	{
		$this->collHorarioCambiosRelatedByCreatedBy[] = $l;
		$l->setUsuarioRelatedByCreatedBy($this);
	}


	
	public function getHorarioCambiosRelatedByCreatedByJoinDia($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorarioCambiosRelatedByCreatedBy === null) {
			if ($this->isNew()) {
				$this->collHorarioCambiosRelatedByCreatedBy = array();
			} else {

				$criteria->add(HorarioCambioPeer::CREATED_BY, $this->getId());

				$this->collHorarioCambiosRelatedByCreatedBy = HorarioCambioPeer::doSelectJoinDia($criteria, $con);
			}
		} else {
									
			$criteria->add(HorarioCambioPeer::CREATED_BY, $this->getId());

			if (!isset($this->lastHorarioCambioRelatedByCreatedByCriteria) || !$this->lastHorarioCambioRelatedByCreatedByCriteria->equals($criteria)) {
				$this->collHorarioCambiosRelatedByCreatedBy = HorarioCambioPeer::doSelectJoinDia($criteria, $con);
			}
		}
		$this->lastHorarioCambioRelatedByCreatedByCriteria = $criteria;

		return $this->collHorarioCambiosRelatedByCreatedBy;
	}


	
	public function getHorarioCambiosRelatedByCreatedByJoinHorarioCambioTipo($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorarioCambiosRelatedByCreatedBy === null) {
			if ($this->isNew()) {
				$this->collHorarioCambiosRelatedByCreatedBy = array();
			} else {

				$criteria->add(HorarioCambioPeer::CREATED_BY, $this->getId());

				$this->collHorarioCambiosRelatedByCreatedBy = HorarioCambioPeer::doSelectJoinHorarioCambioTipo($criteria, $con);
			}
		} else {
									
			$criteria->add(HorarioCambioPeer::CREATED_BY, $this->getId());

			if (!isset($this->lastHorarioCambioRelatedByCreatedByCriteria) || !$this->lastHorarioCambioRelatedByCreatedByCriteria->equals($criteria)) {
				$this->collHorarioCambiosRelatedByCreatedBy = HorarioCambioPeer::doSelectJoinHorarioCambioTipo($criteria, $con);
			}
		}
		$this->lastHorarioCambioRelatedByCreatedByCriteria = $criteria;

		return $this->collHorarioCambiosRelatedByCreatedBy;
	}

	
	public function initHorarioCambiosRelatedByUpdateBy()
	{
		if ($this->collHorarioCambiosRelatedByUpdateBy === null) {
			$this->collHorarioCambiosRelatedByUpdateBy = array();
		}
	}

	
	public function getHorarioCambiosRelatedByUpdateBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorarioCambiosRelatedByUpdateBy === null) {
			if ($this->isNew()) {
			   $this->collHorarioCambiosRelatedByUpdateBy = array();
			} else {

				$criteria->add(HorarioCambioPeer::UPDATE_BY, $this->getId());

				HorarioCambioPeer::addSelectColumns($criteria);
				$this->collHorarioCambiosRelatedByUpdateBy = HorarioCambioPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(HorarioCambioPeer::UPDATE_BY, $this->getId());

				HorarioCambioPeer::addSelectColumns($criteria);
				if (!isset($this->lastHorarioCambioRelatedByUpdateByCriteria) || !$this->lastHorarioCambioRelatedByUpdateByCriteria->equals($criteria)) {
					$this->collHorarioCambiosRelatedByUpdateBy = HorarioCambioPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastHorarioCambioRelatedByUpdateByCriteria = $criteria;
		return $this->collHorarioCambiosRelatedByUpdateBy;
	}

	
	public function countHorarioCambiosRelatedByUpdateBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(HorarioCambioPeer::UPDATE_BY, $this->getId());

		return HorarioCambioPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addHorarioCambioRelatedByUpdateBy(HorarioCambio $l)
	{
		$this->collHorarioCambiosRelatedByUpdateBy[] = $l;
		$l->setUsuarioRelatedByUpdateBy($this);
	}


	
	public function getHorarioCambiosRelatedByUpdateByJoinDia($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorarioCambiosRelatedByUpdateBy === null) {
			if ($this->isNew()) {
				$this->collHorarioCambiosRelatedByUpdateBy = array();
			} else {

				$criteria->add(HorarioCambioPeer::UPDATE_BY, $this->getId());

				$this->collHorarioCambiosRelatedByUpdateBy = HorarioCambioPeer::doSelectJoinDia($criteria, $con);
			}
		} else {
									
			$criteria->add(HorarioCambioPeer::UPDATE_BY, $this->getId());

			if (!isset($this->lastHorarioCambioRelatedByUpdateByCriteria) || !$this->lastHorarioCambioRelatedByUpdateByCriteria->equals($criteria)) {
				$this->collHorarioCambiosRelatedByUpdateBy = HorarioCambioPeer::doSelectJoinDia($criteria, $con);
			}
		}
		$this->lastHorarioCambioRelatedByUpdateByCriteria = $criteria;

		return $this->collHorarioCambiosRelatedByUpdateBy;
	}


	
	public function getHorarioCambiosRelatedByUpdateByJoinHorarioCambioTipo($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorarioCambiosRelatedByUpdateBy === null) {
			if ($this->isNew()) {
				$this->collHorarioCambiosRelatedByUpdateBy = array();
			} else {

				$criteria->add(HorarioCambioPeer::UPDATE_BY, $this->getId());

				$this->collHorarioCambiosRelatedByUpdateBy = HorarioCambioPeer::doSelectJoinHorarioCambioTipo($criteria, $con);
			}
		} else {
									
			$criteria->add(HorarioCambioPeer::UPDATE_BY, $this->getId());

			if (!isset($this->lastHorarioCambioRelatedByUpdateByCriteria) || !$this->lastHorarioCambioRelatedByUpdateByCriteria->equals($criteria)) {
				$this->collHorarioCambiosRelatedByUpdateBy = HorarioCambioPeer::doSelectJoinHorarioCambioTipo($criteria, $con);
			}
		}
		$this->lastHorarioCambioRelatedByUpdateByCriteria = $criteria;

		return $this->collHorarioCambiosRelatedByUpdateBy;
	}

	
	public function initHorarioCambioTiposRelatedByCreatedBy()
	{
		if ($this->collHorarioCambioTiposRelatedByCreatedBy === null) {
			$this->collHorarioCambioTiposRelatedByCreatedBy = array();
		}
	}

	
	public function getHorarioCambioTiposRelatedByCreatedBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioTipoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorarioCambioTiposRelatedByCreatedBy === null) {
			if ($this->isNew()) {
			   $this->collHorarioCambioTiposRelatedByCreatedBy = array();
			} else {

				$criteria->add(HorarioCambioTipoPeer::CREATED_BY, $this->getId());

				HorarioCambioTipoPeer::addSelectColumns($criteria);
				$this->collHorarioCambioTiposRelatedByCreatedBy = HorarioCambioTipoPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(HorarioCambioTipoPeer::CREATED_BY, $this->getId());

				HorarioCambioTipoPeer::addSelectColumns($criteria);
				if (!isset($this->lastHorarioCambioTipoRelatedByCreatedByCriteria) || !$this->lastHorarioCambioTipoRelatedByCreatedByCriteria->equals($criteria)) {
					$this->collHorarioCambioTiposRelatedByCreatedBy = HorarioCambioTipoPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastHorarioCambioTipoRelatedByCreatedByCriteria = $criteria;
		return $this->collHorarioCambioTiposRelatedByCreatedBy;
	}

	
	public function countHorarioCambioTiposRelatedByCreatedBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioTipoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(HorarioCambioTipoPeer::CREATED_BY, $this->getId());

		return HorarioCambioTipoPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addHorarioCambioTipoRelatedByCreatedBy(HorarioCambioTipo $l)
	{
		$this->collHorarioCambioTiposRelatedByCreatedBy[] = $l;
		$l->setUsuarioRelatedByCreatedBy($this);
	}

	
	public function initHorarioCambioTiposRelatedByUpdateBy()
	{
		if ($this->collHorarioCambioTiposRelatedByUpdateBy === null) {
			$this->collHorarioCambioTiposRelatedByUpdateBy = array();
		}
	}

	
	public function getHorarioCambioTiposRelatedByUpdateBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioTipoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorarioCambioTiposRelatedByUpdateBy === null) {
			if ($this->isNew()) {
			   $this->collHorarioCambioTiposRelatedByUpdateBy = array();
			} else {

				$criteria->add(HorarioCambioTipoPeer::UPDATE_BY, $this->getId());

				HorarioCambioTipoPeer::addSelectColumns($criteria);
				$this->collHorarioCambioTiposRelatedByUpdateBy = HorarioCambioTipoPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(HorarioCambioTipoPeer::UPDATE_BY, $this->getId());

				HorarioCambioTipoPeer::addSelectColumns($criteria);
				if (!isset($this->lastHorarioCambioTipoRelatedByUpdateByCriteria) || !$this->lastHorarioCambioTipoRelatedByUpdateByCriteria->equals($criteria)) {
					$this->collHorarioCambioTiposRelatedByUpdateBy = HorarioCambioTipoPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastHorarioCambioTipoRelatedByUpdateByCriteria = $criteria;
		return $this->collHorarioCambioTiposRelatedByUpdateBy;
	}

	
	public function countHorarioCambioTiposRelatedByUpdateBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioCambioTipoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(HorarioCambioTipoPeer::UPDATE_BY, $this->getId());

		return HorarioCambioTipoPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addHorarioCambioTipoRelatedByUpdateBy(HorarioCambioTipo $l)
	{
		$this->collHorarioCambioTiposRelatedByUpdateBy[] = $l;
		$l->setUsuarioRelatedByUpdateBy($this);
	}

	
	public function initPacientesRelatedByCreatedBy()
	{
		if ($this->collPacientesRelatedByCreatedBy === null) {
			$this->collPacientesRelatedByCreatedBy = array();
		}
	}

	
	public function getPacientesRelatedByCreatedBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BasePacientePeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collPacientesRelatedByCreatedBy === null) {
			if ($this->isNew()) {
			   $this->collPacientesRelatedByCreatedBy = array();
			} else {

				$criteria->add(PacientePeer::CREATED_BY, $this->getId());

				PacientePeer::addSelectColumns($criteria);
				$this->collPacientesRelatedByCreatedBy = PacientePeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(PacientePeer::CREATED_BY, $this->getId());

				PacientePeer::addSelectColumns($criteria);
				if (!isset($this->lastPacienteRelatedByCreatedByCriteria) || !$this->lastPacienteRelatedByCreatedByCriteria->equals($criteria)) {
					$this->collPacientesRelatedByCreatedBy = PacientePeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastPacienteRelatedByCreatedByCriteria = $criteria;
		return $this->collPacientesRelatedByCreatedBy;
	}

	
	public function countPacientesRelatedByCreatedBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BasePacientePeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(PacientePeer::CREATED_BY, $this->getId());

		return PacientePeer::doCount($criteria, $distinct, $con);
	}

	
	public function addPacienteRelatedByCreatedBy(Paciente $l)
	{
		$this->collPacientesRelatedByCreatedBy[] = $l;
		$l->setUsuarioRelatedByCreatedBy($this);
	}


	
	public function getPacientesRelatedByCreatedByJoinCobertura($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BasePacientePeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collPacientesRelatedByCreatedBy === null) {
			if ($this->isNew()) {
				$this->collPacientesRelatedByCreatedBy = array();
			} else {

				$criteria->add(PacientePeer::CREATED_BY, $this->getId());

				$this->collPacientesRelatedByCreatedBy = PacientePeer::doSelectJoinCobertura($criteria, $con);
			}
		} else {
									
			$criteria->add(PacientePeer::CREATED_BY, $this->getId());

			if (!isset($this->lastPacienteRelatedByCreatedByCriteria) || !$this->lastPacienteRelatedByCreatedByCriteria->equals($criteria)) {
				$this->collPacientesRelatedByCreatedBy = PacientePeer::doSelectJoinCobertura($criteria, $con);
			}
		}
		$this->lastPacienteRelatedByCreatedByCriteria = $criteria;

		return $this->collPacientesRelatedByCreatedBy;
	}


	
	public function getPacientesRelatedByCreatedByJoinPlan($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BasePacientePeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collPacientesRelatedByCreatedBy === null) {
			if ($this->isNew()) {
				$this->collPacientesRelatedByCreatedBy = array();
			} else {

				$criteria->add(PacientePeer::CREATED_BY, $this->getId());

				$this->collPacientesRelatedByCreatedBy = PacientePeer::doSelectJoinPlan($criteria, $con);
			}
		} else {
									
			$criteria->add(PacientePeer::CREATED_BY, $this->getId());

			if (!isset($this->lastPacienteRelatedByCreatedByCriteria) || !$this->lastPacienteRelatedByCreatedByCriteria->equals($criteria)) {
				$this->collPacientesRelatedByCreatedBy = PacientePeer::doSelectJoinPlan($criteria, $con);
			}
		}
		$this->lastPacienteRelatedByCreatedByCriteria = $criteria;

		return $this->collPacientesRelatedByCreatedBy;
	}

	
	public function initPacientesRelatedByUpdateBy()
	{
		if ($this->collPacientesRelatedByUpdateBy === null) {
			$this->collPacientesRelatedByUpdateBy = array();
		}
	}

	
	public function getPacientesRelatedByUpdateBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BasePacientePeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collPacientesRelatedByUpdateBy === null) {
			if ($this->isNew()) {
			   $this->collPacientesRelatedByUpdateBy = array();
			} else {

				$criteria->add(PacientePeer::UPDATE_BY, $this->getId());

				PacientePeer::addSelectColumns($criteria);
				$this->collPacientesRelatedByUpdateBy = PacientePeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(PacientePeer::UPDATE_BY, $this->getId());

				PacientePeer::addSelectColumns($criteria);
				if (!isset($this->lastPacienteRelatedByUpdateByCriteria) || !$this->lastPacienteRelatedByUpdateByCriteria->equals($criteria)) {
					$this->collPacientesRelatedByUpdateBy = PacientePeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastPacienteRelatedByUpdateByCriteria = $criteria;
		return $this->collPacientesRelatedByUpdateBy;
	}

	
	public function countPacientesRelatedByUpdateBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BasePacientePeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(PacientePeer::UPDATE_BY, $this->getId());

		return PacientePeer::doCount($criteria, $distinct, $con);
	}

	
	public function addPacienteRelatedByUpdateBy(Paciente $l)
	{
		$this->collPacientesRelatedByUpdateBy[] = $l;
		$l->setUsuarioRelatedByUpdateBy($this);
	}


	
	public function getPacientesRelatedByUpdateByJoinCobertura($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BasePacientePeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collPacientesRelatedByUpdateBy === null) {
			if ($this->isNew()) {
				$this->collPacientesRelatedByUpdateBy = array();
			} else {

				$criteria->add(PacientePeer::UPDATE_BY, $this->getId());

				$this->collPacientesRelatedByUpdateBy = PacientePeer::doSelectJoinCobertura($criteria, $con);
			}
		} else {
									
			$criteria->add(PacientePeer::UPDATE_BY, $this->getId());

			if (!isset($this->lastPacienteRelatedByUpdateByCriteria) || !$this->lastPacienteRelatedByUpdateByCriteria->equals($criteria)) {
				$this->collPacientesRelatedByUpdateBy = PacientePeer::doSelectJoinCobertura($criteria, $con);
			}
		}
		$this->lastPacienteRelatedByUpdateByCriteria = $criteria;

		return $this->collPacientesRelatedByUpdateBy;
	}


	
	public function getPacientesRelatedByUpdateByJoinPlan($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BasePacientePeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collPacientesRelatedByUpdateBy === null) {
			if ($this->isNew()) {
				$this->collPacientesRelatedByUpdateBy = array();
			} else {

				$criteria->add(PacientePeer::UPDATE_BY, $this->getId());

				$this->collPacientesRelatedByUpdateBy = PacientePeer::doSelectJoinPlan($criteria, $con);
			}
		} else {
									
			$criteria->add(PacientePeer::UPDATE_BY, $this->getId());

			if (!isset($this->lastPacienteRelatedByUpdateByCriteria) || !$this->lastPacienteRelatedByUpdateByCriteria->equals($criteria)) {
				$this->collPacientesRelatedByUpdateBy = PacientePeer::doSelectJoinPlan($criteria, $con);
			}
		}
		$this->lastPacienteRelatedByUpdateByCriteria = $criteria;

		return $this->collPacientesRelatedByUpdateBy;
	}

	
	public function initPlansRelatedByCreatedBy()
	{
		if ($this->collPlansRelatedByCreatedBy === null) {
			$this->collPlansRelatedByCreatedBy = array();
		}
	}

	
	public function getPlansRelatedByCreatedBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BasePlanPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collPlansRelatedByCreatedBy === null) {
			if ($this->isNew()) {
			   $this->collPlansRelatedByCreatedBy = array();
			} else {

				$criteria->add(PlanPeer::CREATED_BY, $this->getId());

				PlanPeer::addSelectColumns($criteria);
				$this->collPlansRelatedByCreatedBy = PlanPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(PlanPeer::CREATED_BY, $this->getId());

				PlanPeer::addSelectColumns($criteria);
				if (!isset($this->lastPlanRelatedByCreatedByCriteria) || !$this->lastPlanRelatedByCreatedByCriteria->equals($criteria)) {
					$this->collPlansRelatedByCreatedBy = PlanPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastPlanRelatedByCreatedByCriteria = $criteria;
		return $this->collPlansRelatedByCreatedBy;
	}

	
	public function countPlansRelatedByCreatedBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BasePlanPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(PlanPeer::CREATED_BY, $this->getId());

		return PlanPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addPlanRelatedByCreatedBy(Plan $l)
	{
		$this->collPlansRelatedByCreatedBy[] = $l;
		$l->setUsuarioRelatedByCreatedBy($this);
	}


	
	public function getPlansRelatedByCreatedByJoinCobertura($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BasePlanPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collPlansRelatedByCreatedBy === null) {
			if ($this->isNew()) {
				$this->collPlansRelatedByCreatedBy = array();
			} else {

				$criteria->add(PlanPeer::CREATED_BY, $this->getId());

				$this->collPlansRelatedByCreatedBy = PlanPeer::doSelectJoinCobertura($criteria, $con);
			}
		} else {
									
			$criteria->add(PlanPeer::CREATED_BY, $this->getId());

			if (!isset($this->lastPlanRelatedByCreatedByCriteria) || !$this->lastPlanRelatedByCreatedByCriteria->equals($criteria)) {
				$this->collPlansRelatedByCreatedBy = PlanPeer::doSelectJoinCobertura($criteria, $con);
			}
		}
		$this->lastPlanRelatedByCreatedByCriteria = $criteria;

		return $this->collPlansRelatedByCreatedBy;
	}

	
	public function initPlansRelatedByUpdateBy()
	{
		if ($this->collPlansRelatedByUpdateBy === null) {
			$this->collPlansRelatedByUpdateBy = array();
		}
	}

	
	public function getPlansRelatedByUpdateBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BasePlanPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collPlansRelatedByUpdateBy === null) {
			if ($this->isNew()) {
			   $this->collPlansRelatedByUpdateBy = array();
			} else {

				$criteria->add(PlanPeer::UPDATE_BY, $this->getId());

				PlanPeer::addSelectColumns($criteria);
				$this->collPlansRelatedByUpdateBy = PlanPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(PlanPeer::UPDATE_BY, $this->getId());

				PlanPeer::addSelectColumns($criteria);
				if (!isset($this->lastPlanRelatedByUpdateByCriteria) || !$this->lastPlanRelatedByUpdateByCriteria->equals($criteria)) {
					$this->collPlansRelatedByUpdateBy = PlanPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastPlanRelatedByUpdateByCriteria = $criteria;
		return $this->collPlansRelatedByUpdateBy;
	}

	
	public function countPlansRelatedByUpdateBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BasePlanPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(PlanPeer::UPDATE_BY, $this->getId());

		return PlanPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addPlanRelatedByUpdateBy(Plan $l)
	{
		$this->collPlansRelatedByUpdateBy[] = $l;
		$l->setUsuarioRelatedByUpdateBy($this);
	}


	
	public function getPlansRelatedByUpdateByJoinCobertura($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BasePlanPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collPlansRelatedByUpdateBy === null) {
			if ($this->isNew()) {
				$this->collPlansRelatedByUpdateBy = array();
			} else {

				$criteria->add(PlanPeer::UPDATE_BY, $this->getId());

				$this->collPlansRelatedByUpdateBy = PlanPeer::doSelectJoinCobertura($criteria, $con);
			}
		} else {
									
			$criteria->add(PlanPeer::UPDATE_BY, $this->getId());

			if (!isset($this->lastPlanRelatedByUpdateByCriteria) || !$this->lastPlanRelatedByUpdateByCriteria->equals($criteria)) {
				$this->collPlansRelatedByUpdateBy = PlanPeer::doSelectJoinCobertura($criteria, $con);
			}
		}
		$this->lastPlanRelatedByUpdateByCriteria = $criteria;

		return $this->collPlansRelatedByUpdateBy;
	}

	
	public function initRolsRelatedByCreatedBy()
	{
		if ($this->collRolsRelatedByCreatedBy === null) {
			$this->collRolsRelatedByCreatedBy = array();
		}
	}

	
	public function getRolsRelatedByCreatedBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseRolPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collRolsRelatedByCreatedBy === null) {
			if ($this->isNew()) {
			   $this->collRolsRelatedByCreatedBy = array();
			} else {

				$criteria->add(RolPeer::CREATED_BY, $this->getId());

				RolPeer::addSelectColumns($criteria);
				$this->collRolsRelatedByCreatedBy = RolPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(RolPeer::CREATED_BY, $this->getId());

				RolPeer::addSelectColumns($criteria);
				if (!isset($this->lastRolRelatedByCreatedByCriteria) || !$this->lastRolRelatedByCreatedByCriteria->equals($criteria)) {
					$this->collRolsRelatedByCreatedBy = RolPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastRolRelatedByCreatedByCriteria = $criteria;
		return $this->collRolsRelatedByCreatedBy;
	}

	
	public function countRolsRelatedByCreatedBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseRolPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(RolPeer::CREATED_BY, $this->getId());

		return RolPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addRolRelatedByCreatedBy(Rol $l)
	{
		$this->collRolsRelatedByCreatedBy[] = $l;
		$l->setUsuarioRelatedByCreatedBy($this);
	}

	
	public function initRolsRelatedByUpdateBy()
	{
		if ($this->collRolsRelatedByUpdateBy === null) {
			$this->collRolsRelatedByUpdateBy = array();
		}
	}

	
	public function getRolsRelatedByUpdateBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseRolPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collRolsRelatedByUpdateBy === null) {
			if ($this->isNew()) {
			   $this->collRolsRelatedByUpdateBy = array();
			} else {

				$criteria->add(RolPeer::UPDATE_BY, $this->getId());

				RolPeer::addSelectColumns($criteria);
				$this->collRolsRelatedByUpdateBy = RolPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(RolPeer::UPDATE_BY, $this->getId());

				RolPeer::addSelectColumns($criteria);
				if (!isset($this->lastRolRelatedByUpdateByCriteria) || !$this->lastRolRelatedByUpdateByCriteria->equals($criteria)) {
					$this->collRolsRelatedByUpdateBy = RolPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastRolRelatedByUpdateByCriteria = $criteria;
		return $this->collRolsRelatedByUpdateBy;
	}

	
	public function countRolsRelatedByUpdateBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseRolPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(RolPeer::UPDATE_BY, $this->getId());

		return RolPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addRolRelatedByUpdateBy(Rol $l)
	{
		$this->collRolsRelatedByUpdateBy[] = $l;
		$l->setUsuarioRelatedByUpdateBy($this);
	}

	
	public function initRolCredencialsRelatedByCreatedBy()
	{
		if ($this->collRolCredencialsRelatedByCreatedBy === null) {
			$this->collRolCredencialsRelatedByCreatedBy = array();
		}
	}

	
	public function getRolCredencialsRelatedByCreatedBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseRolCredencialPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collRolCredencialsRelatedByCreatedBy === null) {
			if ($this->isNew()) {
			   $this->collRolCredencialsRelatedByCreatedBy = array();
			} else {

				$criteria->add(RolCredencialPeer::CREATED_BY, $this->getId());

				RolCredencialPeer::addSelectColumns($criteria);
				$this->collRolCredencialsRelatedByCreatedBy = RolCredencialPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(RolCredencialPeer::CREATED_BY, $this->getId());

				RolCredencialPeer::addSelectColumns($criteria);
				if (!isset($this->lastRolCredencialRelatedByCreatedByCriteria) || !$this->lastRolCredencialRelatedByCreatedByCriteria->equals($criteria)) {
					$this->collRolCredencialsRelatedByCreatedBy = RolCredencialPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastRolCredencialRelatedByCreatedByCriteria = $criteria;
		return $this->collRolCredencialsRelatedByCreatedBy;
	}

	
	public function countRolCredencialsRelatedByCreatedBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseRolCredencialPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(RolCredencialPeer::CREATED_BY, $this->getId());

		return RolCredencialPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addRolCredencialRelatedByCreatedBy(RolCredencial $l)
	{
		$this->collRolCredencialsRelatedByCreatedBy[] = $l;
		$l->setUsuarioRelatedByCreatedBy($this);
	}


	
	public function getRolCredencialsRelatedByCreatedByJoinRol($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseRolCredencialPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collRolCredencialsRelatedByCreatedBy === null) {
			if ($this->isNew()) {
				$this->collRolCredencialsRelatedByCreatedBy = array();
			} else {

				$criteria->add(RolCredencialPeer::CREATED_BY, $this->getId());

				$this->collRolCredencialsRelatedByCreatedBy = RolCredencialPeer::doSelectJoinRol($criteria, $con);
			}
		} else {
									
			$criteria->add(RolCredencialPeer::CREATED_BY, $this->getId());

			if (!isset($this->lastRolCredencialRelatedByCreatedByCriteria) || !$this->lastRolCredencialRelatedByCreatedByCriteria->equals($criteria)) {
				$this->collRolCredencialsRelatedByCreatedBy = RolCredencialPeer::doSelectJoinRol($criteria, $con);
			}
		}
		$this->lastRolCredencialRelatedByCreatedByCriteria = $criteria;

		return $this->collRolCredencialsRelatedByCreatedBy;
	}


	
	public function getRolCredencialsRelatedByCreatedByJoinCredencial($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseRolCredencialPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collRolCredencialsRelatedByCreatedBy === null) {
			if ($this->isNew()) {
				$this->collRolCredencialsRelatedByCreatedBy = array();
			} else {

				$criteria->add(RolCredencialPeer::CREATED_BY, $this->getId());

				$this->collRolCredencialsRelatedByCreatedBy = RolCredencialPeer::doSelectJoinCredencial($criteria, $con);
			}
		} else {
									
			$criteria->add(RolCredencialPeer::CREATED_BY, $this->getId());

			if (!isset($this->lastRolCredencialRelatedByCreatedByCriteria) || !$this->lastRolCredencialRelatedByCreatedByCriteria->equals($criteria)) {
				$this->collRolCredencialsRelatedByCreatedBy = RolCredencialPeer::doSelectJoinCredencial($criteria, $con);
			}
		}
		$this->lastRolCredencialRelatedByCreatedByCriteria = $criteria;

		return $this->collRolCredencialsRelatedByCreatedBy;
	}

	
	public function initRolCredencialsRelatedByUpdateBy()
	{
		if ($this->collRolCredencialsRelatedByUpdateBy === null) {
			$this->collRolCredencialsRelatedByUpdateBy = array();
		}
	}

	
	public function getRolCredencialsRelatedByUpdateBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseRolCredencialPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collRolCredencialsRelatedByUpdateBy === null) {
			if ($this->isNew()) {
			   $this->collRolCredencialsRelatedByUpdateBy = array();
			} else {

				$criteria->add(RolCredencialPeer::UPDATE_BY, $this->getId());

				RolCredencialPeer::addSelectColumns($criteria);
				$this->collRolCredencialsRelatedByUpdateBy = RolCredencialPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(RolCredencialPeer::UPDATE_BY, $this->getId());

				RolCredencialPeer::addSelectColumns($criteria);
				if (!isset($this->lastRolCredencialRelatedByUpdateByCriteria) || !$this->lastRolCredencialRelatedByUpdateByCriteria->equals($criteria)) {
					$this->collRolCredencialsRelatedByUpdateBy = RolCredencialPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastRolCredencialRelatedByUpdateByCriteria = $criteria;
		return $this->collRolCredencialsRelatedByUpdateBy;
	}

	
	public function countRolCredencialsRelatedByUpdateBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseRolCredencialPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(RolCredencialPeer::UPDATE_BY, $this->getId());

		return RolCredencialPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addRolCredencialRelatedByUpdateBy(RolCredencial $l)
	{
		$this->collRolCredencialsRelatedByUpdateBy[] = $l;
		$l->setUsuarioRelatedByUpdateBy($this);
	}


	
	public function getRolCredencialsRelatedByUpdateByJoinRol($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseRolCredencialPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collRolCredencialsRelatedByUpdateBy === null) {
			if ($this->isNew()) {
				$this->collRolCredencialsRelatedByUpdateBy = array();
			} else {

				$criteria->add(RolCredencialPeer::UPDATE_BY, $this->getId());

				$this->collRolCredencialsRelatedByUpdateBy = RolCredencialPeer::doSelectJoinRol($criteria, $con);
			}
		} else {
									
			$criteria->add(RolCredencialPeer::UPDATE_BY, $this->getId());

			if (!isset($this->lastRolCredencialRelatedByUpdateByCriteria) || !$this->lastRolCredencialRelatedByUpdateByCriteria->equals($criteria)) {
				$this->collRolCredencialsRelatedByUpdateBy = RolCredencialPeer::doSelectJoinRol($criteria, $con);
			}
		}
		$this->lastRolCredencialRelatedByUpdateByCriteria = $criteria;

		return $this->collRolCredencialsRelatedByUpdateBy;
	}


	
	public function getRolCredencialsRelatedByUpdateByJoinCredencial($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseRolCredencialPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collRolCredencialsRelatedByUpdateBy === null) {
			if ($this->isNew()) {
				$this->collRolCredencialsRelatedByUpdateBy = array();
			} else {

				$criteria->add(RolCredencialPeer::UPDATE_BY, $this->getId());

				$this->collRolCredencialsRelatedByUpdateBy = RolCredencialPeer::doSelectJoinCredencial($criteria, $con);
			}
		} else {
									
			$criteria->add(RolCredencialPeer::UPDATE_BY, $this->getId());

			if (!isset($this->lastRolCredencialRelatedByUpdateByCriteria) || !$this->lastRolCredencialRelatedByUpdateByCriteria->equals($criteria)) {
				$this->collRolCredencialsRelatedByUpdateBy = RolCredencialPeer::doSelectJoinCredencial($criteria, $con);
			}
		}
		$this->lastRolCredencialRelatedByUpdateByCriteria = $criteria;

		return $this->collRolCredencialsRelatedByUpdateBy;
	}

	
	public function initTurnosRelatedByMedicoId()
	{
		if ($this->collTurnosRelatedByMedicoId === null) {
			$this->collTurnosRelatedByMedicoId = array();
		}
	}

	
	public function getTurnosRelatedByMedicoId($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTurnosRelatedByMedicoId === null) {
			if ($this->isNew()) {
			   $this->collTurnosRelatedByMedicoId = array();
			} else {

				$criteria->add(TurnoPeer::MEDICO_ID, $this->getId());

				TurnoPeer::addSelectColumns($criteria);
				$this->collTurnosRelatedByMedicoId = TurnoPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(TurnoPeer::MEDICO_ID, $this->getId());

				TurnoPeer::addSelectColumns($criteria);
				if (!isset($this->lastTurnoRelatedByMedicoIdCriteria) || !$this->lastTurnoRelatedByMedicoIdCriteria->equals($criteria)) {
					$this->collTurnosRelatedByMedicoId = TurnoPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTurnoRelatedByMedicoIdCriteria = $criteria;
		return $this->collTurnosRelatedByMedicoId;
	}

	
	public function countTurnosRelatedByMedicoId($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(TurnoPeer::MEDICO_ID, $this->getId());

		return TurnoPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addTurnoRelatedByMedicoId(Turno $l)
	{
		$this->collTurnosRelatedByMedicoId[] = $l;
		$l->setUsuarioRelatedByMedicoId($this);
	}


	
	public function getTurnosRelatedByMedicoIdJoinPaciente($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTurnosRelatedByMedicoId === null) {
			if ($this->isNew()) {
				$this->collTurnosRelatedByMedicoId = array();
			} else {

				$criteria->add(TurnoPeer::MEDICO_ID, $this->getId());

				$this->collTurnosRelatedByMedicoId = TurnoPeer::doSelectJoinPaciente($criteria, $con);
			}
		} else {
									
			$criteria->add(TurnoPeer::MEDICO_ID, $this->getId());

			if (!isset($this->lastTurnoRelatedByMedicoIdCriteria) || !$this->lastTurnoRelatedByMedicoIdCriteria->equals($criteria)) {
				$this->collTurnosRelatedByMedicoId = TurnoPeer::doSelectJoinPaciente($criteria, $con);
			}
		}
		$this->lastTurnoRelatedByMedicoIdCriteria = $criteria;

		return $this->collTurnosRelatedByMedicoId;
	}


	
	public function getTurnosRelatedByMedicoIdJoinEstudio($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTurnosRelatedByMedicoId === null) {
			if ($this->isNew()) {
				$this->collTurnosRelatedByMedicoId = array();
			} else {

				$criteria->add(TurnoPeer::MEDICO_ID, $this->getId());

				$this->collTurnosRelatedByMedicoId = TurnoPeer::doSelectJoinEstudio($criteria, $con);
			}
		} else {
									
			$criteria->add(TurnoPeer::MEDICO_ID, $this->getId());

			if (!isset($this->lastTurnoRelatedByMedicoIdCriteria) || !$this->lastTurnoRelatedByMedicoIdCriteria->equals($criteria)) {
				$this->collTurnosRelatedByMedicoId = TurnoPeer::doSelectJoinEstudio($criteria, $con);
			}
		}
		$this->lastTurnoRelatedByMedicoIdCriteria = $criteria;

		return $this->collTurnosRelatedByMedicoId;
	}

	
	public function initTurnosRelatedByCreatedBy()
	{
		if ($this->collTurnosRelatedByCreatedBy === null) {
			$this->collTurnosRelatedByCreatedBy = array();
		}
	}

	
	public function getTurnosRelatedByCreatedBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTurnosRelatedByCreatedBy === null) {
			if ($this->isNew()) {
			   $this->collTurnosRelatedByCreatedBy = array();
			} else {

				$criteria->add(TurnoPeer::CREATED_BY, $this->getId());

				TurnoPeer::addSelectColumns($criteria);
				$this->collTurnosRelatedByCreatedBy = TurnoPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(TurnoPeer::CREATED_BY, $this->getId());

				TurnoPeer::addSelectColumns($criteria);
				if (!isset($this->lastTurnoRelatedByCreatedByCriteria) || !$this->lastTurnoRelatedByCreatedByCriteria->equals($criteria)) {
					$this->collTurnosRelatedByCreatedBy = TurnoPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTurnoRelatedByCreatedByCriteria = $criteria;
		return $this->collTurnosRelatedByCreatedBy;
	}

	
	public function countTurnosRelatedByCreatedBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(TurnoPeer::CREATED_BY, $this->getId());

		return TurnoPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addTurnoRelatedByCreatedBy(Turno $l)
	{
		$this->collTurnosRelatedByCreatedBy[] = $l;
		$l->setUsuarioRelatedByCreatedBy($this);
	}


	
	public function getTurnosRelatedByCreatedByJoinPaciente($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTurnosRelatedByCreatedBy === null) {
			if ($this->isNew()) {
				$this->collTurnosRelatedByCreatedBy = array();
			} else {

				$criteria->add(TurnoPeer::CREATED_BY, $this->getId());

				$this->collTurnosRelatedByCreatedBy = TurnoPeer::doSelectJoinPaciente($criteria, $con);
			}
		} else {
									
			$criteria->add(TurnoPeer::CREATED_BY, $this->getId());

			if (!isset($this->lastTurnoRelatedByCreatedByCriteria) || !$this->lastTurnoRelatedByCreatedByCriteria->equals($criteria)) {
				$this->collTurnosRelatedByCreatedBy = TurnoPeer::doSelectJoinPaciente($criteria, $con);
			}
		}
		$this->lastTurnoRelatedByCreatedByCriteria = $criteria;

		return $this->collTurnosRelatedByCreatedBy;
	}


	
	public function getTurnosRelatedByCreatedByJoinEstudio($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTurnosRelatedByCreatedBy === null) {
			if ($this->isNew()) {
				$this->collTurnosRelatedByCreatedBy = array();
			} else {

				$criteria->add(TurnoPeer::CREATED_BY, $this->getId());

				$this->collTurnosRelatedByCreatedBy = TurnoPeer::doSelectJoinEstudio($criteria, $con);
			}
		} else {
									
			$criteria->add(TurnoPeer::CREATED_BY, $this->getId());

			if (!isset($this->lastTurnoRelatedByCreatedByCriteria) || !$this->lastTurnoRelatedByCreatedByCriteria->equals($criteria)) {
				$this->collTurnosRelatedByCreatedBy = TurnoPeer::doSelectJoinEstudio($criteria, $con);
			}
		}
		$this->lastTurnoRelatedByCreatedByCriteria = $criteria;

		return $this->collTurnosRelatedByCreatedBy;
	}

	
	public function initTurnosRelatedByUpdateBy()
	{
		if ($this->collTurnosRelatedByUpdateBy === null) {
			$this->collTurnosRelatedByUpdateBy = array();
		}
	}

	
	public function getTurnosRelatedByUpdateBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTurnosRelatedByUpdateBy === null) {
			if ($this->isNew()) {
			   $this->collTurnosRelatedByUpdateBy = array();
			} else {

				$criteria->add(TurnoPeer::UPDATE_BY, $this->getId());

				TurnoPeer::addSelectColumns($criteria);
				$this->collTurnosRelatedByUpdateBy = TurnoPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(TurnoPeer::UPDATE_BY, $this->getId());

				TurnoPeer::addSelectColumns($criteria);
				if (!isset($this->lastTurnoRelatedByUpdateByCriteria) || !$this->lastTurnoRelatedByUpdateByCriteria->equals($criteria)) {
					$this->collTurnosRelatedByUpdateBy = TurnoPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTurnoRelatedByUpdateByCriteria = $criteria;
		return $this->collTurnosRelatedByUpdateBy;
	}

	
	public function countTurnosRelatedByUpdateBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(TurnoPeer::UPDATE_BY, $this->getId());

		return TurnoPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addTurnoRelatedByUpdateBy(Turno $l)
	{
		$this->collTurnosRelatedByUpdateBy[] = $l;
		$l->setUsuarioRelatedByUpdateBy($this);
	}


	
	public function getTurnosRelatedByUpdateByJoinPaciente($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTurnosRelatedByUpdateBy === null) {
			if ($this->isNew()) {
				$this->collTurnosRelatedByUpdateBy = array();
			} else {

				$criteria->add(TurnoPeer::UPDATE_BY, $this->getId());

				$this->collTurnosRelatedByUpdateBy = TurnoPeer::doSelectJoinPaciente($criteria, $con);
			}
		} else {
									
			$criteria->add(TurnoPeer::UPDATE_BY, $this->getId());

			if (!isset($this->lastTurnoRelatedByUpdateByCriteria) || !$this->lastTurnoRelatedByUpdateByCriteria->equals($criteria)) {
				$this->collTurnosRelatedByUpdateBy = TurnoPeer::doSelectJoinPaciente($criteria, $con);
			}
		}
		$this->lastTurnoRelatedByUpdateByCriteria = $criteria;

		return $this->collTurnosRelatedByUpdateBy;
	}


	
	public function getTurnosRelatedByUpdateByJoinEstudio($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTurnosRelatedByUpdateBy === null) {
			if ($this->isNew()) {
				$this->collTurnosRelatedByUpdateBy = array();
			} else {

				$criteria->add(TurnoPeer::UPDATE_BY, $this->getId());

				$this->collTurnosRelatedByUpdateBy = TurnoPeer::doSelectJoinEstudio($criteria, $con);
			}
		} else {
									
			$criteria->add(TurnoPeer::UPDATE_BY, $this->getId());

			if (!isset($this->lastTurnoRelatedByUpdateByCriteria) || !$this->lastTurnoRelatedByUpdateByCriteria->equals($criteria)) {
				$this->collTurnosRelatedByUpdateBy = TurnoPeer::doSelectJoinEstudio($criteria, $con);
			}
		}
		$this->lastTurnoRelatedByUpdateByCriteria = $criteria;

		return $this->collTurnosRelatedByUpdateBy;
	}

	
	public function initTurnoCambioEstadosRelatedByCreatedBy()
	{
		if ($this->collTurnoCambioEstadosRelatedByCreatedBy === null) {
			$this->collTurnoCambioEstadosRelatedByCreatedBy = array();
		}
	}

	
	public function getTurnoCambioEstadosRelatedByCreatedBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoCambioEstadoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTurnoCambioEstadosRelatedByCreatedBy === null) {
			if ($this->isNew()) {
			   $this->collTurnoCambioEstadosRelatedByCreatedBy = array();
			} else {

				$criteria->add(TurnoCambioEstadoPeer::CREATED_BY, $this->getId());

				TurnoCambioEstadoPeer::addSelectColumns($criteria);
				$this->collTurnoCambioEstadosRelatedByCreatedBy = TurnoCambioEstadoPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(TurnoCambioEstadoPeer::CREATED_BY, $this->getId());

				TurnoCambioEstadoPeer::addSelectColumns($criteria);
				if (!isset($this->lastTurnoCambioEstadoRelatedByCreatedByCriteria) || !$this->lastTurnoCambioEstadoRelatedByCreatedByCriteria->equals($criteria)) {
					$this->collTurnoCambioEstadosRelatedByCreatedBy = TurnoCambioEstadoPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTurnoCambioEstadoRelatedByCreatedByCriteria = $criteria;
		return $this->collTurnoCambioEstadosRelatedByCreatedBy;
	}

	
	public function countTurnoCambioEstadosRelatedByCreatedBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoCambioEstadoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(TurnoCambioEstadoPeer::CREATED_BY, $this->getId());

		return TurnoCambioEstadoPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addTurnoCambioEstadoRelatedByCreatedBy(TurnoCambioEstado $l)
	{
		$this->collTurnoCambioEstadosRelatedByCreatedBy[] = $l;
		$l->setUsuarioRelatedByCreatedBy($this);
	}


	
	public function getTurnoCambioEstadosRelatedByCreatedByJoinTurnoEstado($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoCambioEstadoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTurnoCambioEstadosRelatedByCreatedBy === null) {
			if ($this->isNew()) {
				$this->collTurnoCambioEstadosRelatedByCreatedBy = array();
			} else {

				$criteria->add(TurnoCambioEstadoPeer::CREATED_BY, $this->getId());

				$this->collTurnoCambioEstadosRelatedByCreatedBy = TurnoCambioEstadoPeer::doSelectJoinTurnoEstado($criteria, $con);
			}
		} else {
									
			$criteria->add(TurnoCambioEstadoPeer::CREATED_BY, $this->getId());

			if (!isset($this->lastTurnoCambioEstadoRelatedByCreatedByCriteria) || !$this->lastTurnoCambioEstadoRelatedByCreatedByCriteria->equals($criteria)) {
				$this->collTurnoCambioEstadosRelatedByCreatedBy = TurnoCambioEstadoPeer::doSelectJoinTurnoEstado($criteria, $con);
			}
		}
		$this->lastTurnoCambioEstadoRelatedByCreatedByCriteria = $criteria;

		return $this->collTurnoCambioEstadosRelatedByCreatedBy;
	}


	
	public function getTurnoCambioEstadosRelatedByCreatedByJoinTurno($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoCambioEstadoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTurnoCambioEstadosRelatedByCreatedBy === null) {
			if ($this->isNew()) {
				$this->collTurnoCambioEstadosRelatedByCreatedBy = array();
			} else {

				$criteria->add(TurnoCambioEstadoPeer::CREATED_BY, $this->getId());

				$this->collTurnoCambioEstadosRelatedByCreatedBy = TurnoCambioEstadoPeer::doSelectJoinTurno($criteria, $con);
			}
		} else {
									
			$criteria->add(TurnoCambioEstadoPeer::CREATED_BY, $this->getId());

			if (!isset($this->lastTurnoCambioEstadoRelatedByCreatedByCriteria) || !$this->lastTurnoCambioEstadoRelatedByCreatedByCriteria->equals($criteria)) {
				$this->collTurnoCambioEstadosRelatedByCreatedBy = TurnoCambioEstadoPeer::doSelectJoinTurno($criteria, $con);
			}
		}
		$this->lastTurnoCambioEstadoRelatedByCreatedByCriteria = $criteria;

		return $this->collTurnoCambioEstadosRelatedByCreatedBy;
	}

	
	public function initTurnoCambioEstadosRelatedByUpdateBy()
	{
		if ($this->collTurnoCambioEstadosRelatedByUpdateBy === null) {
			$this->collTurnoCambioEstadosRelatedByUpdateBy = array();
		}
	}

	
	public function getTurnoCambioEstadosRelatedByUpdateBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoCambioEstadoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTurnoCambioEstadosRelatedByUpdateBy === null) {
			if ($this->isNew()) {
			   $this->collTurnoCambioEstadosRelatedByUpdateBy = array();
			} else {

				$criteria->add(TurnoCambioEstadoPeer::UPDATE_BY, $this->getId());

				TurnoCambioEstadoPeer::addSelectColumns($criteria);
				$this->collTurnoCambioEstadosRelatedByUpdateBy = TurnoCambioEstadoPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(TurnoCambioEstadoPeer::UPDATE_BY, $this->getId());

				TurnoCambioEstadoPeer::addSelectColumns($criteria);
				if (!isset($this->lastTurnoCambioEstadoRelatedByUpdateByCriteria) || !$this->lastTurnoCambioEstadoRelatedByUpdateByCriteria->equals($criteria)) {
					$this->collTurnoCambioEstadosRelatedByUpdateBy = TurnoCambioEstadoPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTurnoCambioEstadoRelatedByUpdateByCriteria = $criteria;
		return $this->collTurnoCambioEstadosRelatedByUpdateBy;
	}

	
	public function countTurnoCambioEstadosRelatedByUpdateBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoCambioEstadoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(TurnoCambioEstadoPeer::UPDATE_BY, $this->getId());

		return TurnoCambioEstadoPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addTurnoCambioEstadoRelatedByUpdateBy(TurnoCambioEstado $l)
	{
		$this->collTurnoCambioEstadosRelatedByUpdateBy[] = $l;
		$l->setUsuarioRelatedByUpdateBy($this);
	}


	
	public function getTurnoCambioEstadosRelatedByUpdateByJoinTurnoEstado($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoCambioEstadoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTurnoCambioEstadosRelatedByUpdateBy === null) {
			if ($this->isNew()) {
				$this->collTurnoCambioEstadosRelatedByUpdateBy = array();
			} else {

				$criteria->add(TurnoCambioEstadoPeer::UPDATE_BY, $this->getId());

				$this->collTurnoCambioEstadosRelatedByUpdateBy = TurnoCambioEstadoPeer::doSelectJoinTurnoEstado($criteria, $con);
			}
		} else {
									
			$criteria->add(TurnoCambioEstadoPeer::UPDATE_BY, $this->getId());

			if (!isset($this->lastTurnoCambioEstadoRelatedByUpdateByCriteria) || !$this->lastTurnoCambioEstadoRelatedByUpdateByCriteria->equals($criteria)) {
				$this->collTurnoCambioEstadosRelatedByUpdateBy = TurnoCambioEstadoPeer::doSelectJoinTurnoEstado($criteria, $con);
			}
		}
		$this->lastTurnoCambioEstadoRelatedByUpdateByCriteria = $criteria;

		return $this->collTurnoCambioEstadosRelatedByUpdateBy;
	}


	
	public function getTurnoCambioEstadosRelatedByUpdateByJoinTurno($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoCambioEstadoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTurnoCambioEstadosRelatedByUpdateBy === null) {
			if ($this->isNew()) {
				$this->collTurnoCambioEstadosRelatedByUpdateBy = array();
			} else {

				$criteria->add(TurnoCambioEstadoPeer::UPDATE_BY, $this->getId());

				$this->collTurnoCambioEstadosRelatedByUpdateBy = TurnoCambioEstadoPeer::doSelectJoinTurno($criteria, $con);
			}
		} else {
									
			$criteria->add(TurnoCambioEstadoPeer::UPDATE_BY, $this->getId());

			if (!isset($this->lastTurnoCambioEstadoRelatedByUpdateByCriteria) || !$this->lastTurnoCambioEstadoRelatedByUpdateByCriteria->equals($criteria)) {
				$this->collTurnoCambioEstadosRelatedByUpdateBy = TurnoCambioEstadoPeer::doSelectJoinTurno($criteria, $con);
			}
		}
		$this->lastTurnoCambioEstadoRelatedByUpdateByCriteria = $criteria;

		return $this->collTurnoCambioEstadosRelatedByUpdateBy;
	}

	
	public function initTurnoEstadosRelatedByCreatedBy()
	{
		if ($this->collTurnoEstadosRelatedByCreatedBy === null) {
			$this->collTurnoEstadosRelatedByCreatedBy = array();
		}
	}

	
	public function getTurnoEstadosRelatedByCreatedBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoEstadoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTurnoEstadosRelatedByCreatedBy === null) {
			if ($this->isNew()) {
			   $this->collTurnoEstadosRelatedByCreatedBy = array();
			} else {

				$criteria->add(TurnoEstadoPeer::CREATED_BY, $this->getId());

				TurnoEstadoPeer::addSelectColumns($criteria);
				$this->collTurnoEstadosRelatedByCreatedBy = TurnoEstadoPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(TurnoEstadoPeer::CREATED_BY, $this->getId());

				TurnoEstadoPeer::addSelectColumns($criteria);
				if (!isset($this->lastTurnoEstadoRelatedByCreatedByCriteria) || !$this->lastTurnoEstadoRelatedByCreatedByCriteria->equals($criteria)) {
					$this->collTurnoEstadosRelatedByCreatedBy = TurnoEstadoPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTurnoEstadoRelatedByCreatedByCriteria = $criteria;
		return $this->collTurnoEstadosRelatedByCreatedBy;
	}

	
	public function countTurnoEstadosRelatedByCreatedBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoEstadoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(TurnoEstadoPeer::CREATED_BY, $this->getId());

		return TurnoEstadoPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addTurnoEstadoRelatedByCreatedBy(TurnoEstado $l)
	{
		$this->collTurnoEstadosRelatedByCreatedBy[] = $l;
		$l->setUsuarioRelatedByCreatedBy($this);
	}

	
	public function initTurnoEstadosRelatedByUpdateBy()
	{
		if ($this->collTurnoEstadosRelatedByUpdateBy === null) {
			$this->collTurnoEstadosRelatedByUpdateBy = array();
		}
	}

	
	public function getTurnoEstadosRelatedByUpdateBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoEstadoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTurnoEstadosRelatedByUpdateBy === null) {
			if ($this->isNew()) {
			   $this->collTurnoEstadosRelatedByUpdateBy = array();
			} else {

				$criteria->add(TurnoEstadoPeer::UPDATE_BY, $this->getId());

				TurnoEstadoPeer::addSelectColumns($criteria);
				$this->collTurnoEstadosRelatedByUpdateBy = TurnoEstadoPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(TurnoEstadoPeer::UPDATE_BY, $this->getId());

				TurnoEstadoPeer::addSelectColumns($criteria);
				if (!isset($this->lastTurnoEstadoRelatedByUpdateByCriteria) || !$this->lastTurnoEstadoRelatedByUpdateByCriteria->equals($criteria)) {
					$this->collTurnoEstadosRelatedByUpdateBy = TurnoEstadoPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTurnoEstadoRelatedByUpdateByCriteria = $criteria;
		return $this->collTurnoEstadosRelatedByUpdateBy;
	}

	
	public function countTurnoEstadosRelatedByUpdateBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseTurnoEstadoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(TurnoEstadoPeer::UPDATE_BY, $this->getId());

		return TurnoEstadoPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addTurnoEstadoRelatedByUpdateBy(TurnoEstado $l)
	{
		$this->collTurnoEstadosRelatedByUpdateBy[] = $l;
		$l->setUsuarioRelatedByUpdateBy($this);
	}

	
	public function initUsuariosRelatedByCreatedBy()
	{
		if ($this->collUsuariosRelatedByCreatedBy === null) {
			$this->collUsuariosRelatedByCreatedBy = array();
		}
	}

	
	public function getUsuariosRelatedByCreatedBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseUsuarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collUsuariosRelatedByCreatedBy === null) {
			if ($this->isNew()) {
			   $this->collUsuariosRelatedByCreatedBy = array();
			} else {

				$criteria->add(UsuarioPeer::CREATED_BY, $this->getId());

				UsuarioPeer::addSelectColumns($criteria);
				$this->collUsuariosRelatedByCreatedBy = UsuarioPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(UsuarioPeer::CREATED_BY, $this->getId());

				UsuarioPeer::addSelectColumns($criteria);
				if (!isset($this->lastUsuarioRelatedByCreatedByCriteria) || !$this->lastUsuarioRelatedByCreatedByCriteria->equals($criteria)) {
					$this->collUsuariosRelatedByCreatedBy = UsuarioPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastUsuarioRelatedByCreatedByCriteria = $criteria;
		return $this->collUsuariosRelatedByCreatedBy;
	}

	
	public function countUsuariosRelatedByCreatedBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseUsuarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(UsuarioPeer::CREATED_BY, $this->getId());

		return UsuarioPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addUsuarioRelatedByCreatedBy(Usuario $l)
	{
		$this->collUsuariosRelatedByCreatedBy[] = $l;
		$l->setUsuarioRelatedByCreatedBy($this);
	}


	
	public function getUsuariosRelatedByCreatedByJoinRol($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseUsuarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collUsuariosRelatedByCreatedBy === null) {
			if ($this->isNew()) {
				$this->collUsuariosRelatedByCreatedBy = array();
			} else {

				$criteria->add(UsuarioPeer::CREATED_BY, $this->getId());

				$this->collUsuariosRelatedByCreatedBy = UsuarioPeer::doSelectJoinRol($criteria, $con);
			}
		} else {
									
			$criteria->add(UsuarioPeer::CREATED_BY, $this->getId());

			if (!isset($this->lastUsuarioRelatedByCreatedByCriteria) || !$this->lastUsuarioRelatedByCreatedByCriteria->equals($criteria)) {
				$this->collUsuariosRelatedByCreatedBy = UsuarioPeer::doSelectJoinRol($criteria, $con);
			}
		}
		$this->lastUsuarioRelatedByCreatedByCriteria = $criteria;

		return $this->collUsuariosRelatedByCreatedBy;
	}

	
	public function initUsuariosRelatedByUpdateBy()
	{
		if ($this->collUsuariosRelatedByUpdateBy === null) {
			$this->collUsuariosRelatedByUpdateBy = array();
		}
	}

	
	public function getUsuariosRelatedByUpdateBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseUsuarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collUsuariosRelatedByUpdateBy === null) {
			if ($this->isNew()) {
			   $this->collUsuariosRelatedByUpdateBy = array();
			} else {

				$criteria->add(UsuarioPeer::UPDATE_BY, $this->getId());

				UsuarioPeer::addSelectColumns($criteria);
				$this->collUsuariosRelatedByUpdateBy = UsuarioPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(UsuarioPeer::UPDATE_BY, $this->getId());

				UsuarioPeer::addSelectColumns($criteria);
				if (!isset($this->lastUsuarioRelatedByUpdateByCriteria) || !$this->lastUsuarioRelatedByUpdateByCriteria->equals($criteria)) {
					$this->collUsuariosRelatedByUpdateBy = UsuarioPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastUsuarioRelatedByUpdateByCriteria = $criteria;
		return $this->collUsuariosRelatedByUpdateBy;
	}

	
	public function countUsuariosRelatedByUpdateBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseUsuarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(UsuarioPeer::UPDATE_BY, $this->getId());

		return UsuarioPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addUsuarioRelatedByUpdateBy(Usuario $l)
	{
		$this->collUsuariosRelatedByUpdateBy[] = $l;
		$l->setUsuarioRelatedByUpdateBy($this);
	}


	
	public function getUsuariosRelatedByUpdateByJoinRol($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseUsuarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collUsuariosRelatedByUpdateBy === null) {
			if ($this->isNew()) {
				$this->collUsuariosRelatedByUpdateBy = array();
			} else {

				$criteria->add(UsuarioPeer::UPDATE_BY, $this->getId());

				$this->collUsuariosRelatedByUpdateBy = UsuarioPeer::doSelectJoinRol($criteria, $con);
			}
		} else {
									
			$criteria->add(UsuarioPeer::UPDATE_BY, $this->getId());

			if (!isset($this->lastUsuarioRelatedByUpdateByCriteria) || !$this->lastUsuarioRelatedByUpdateByCriteria->equals($criteria)) {
				$this->collUsuariosRelatedByUpdateBy = UsuarioPeer::doSelectJoinRol($criteria, $con);
			}
		}
		$this->lastUsuarioRelatedByUpdateByCriteria = $criteria;

		return $this->collUsuariosRelatedByUpdateBy;
	}

	
	public function initUsuarioEstudiosRelatedByUsuarioId()
	{
		if ($this->collUsuarioEstudiosRelatedByUsuarioId === null) {
			$this->collUsuarioEstudiosRelatedByUsuarioId = array();
		}
	}

	
	public function getUsuarioEstudiosRelatedByUsuarioId($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseUsuarioEstudioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collUsuarioEstudiosRelatedByUsuarioId === null) {
			if ($this->isNew()) {
			   $this->collUsuarioEstudiosRelatedByUsuarioId = array();
			} else {

				$criteria->add(UsuarioEstudioPeer::USUARIO_ID, $this->getId());

				UsuarioEstudioPeer::addSelectColumns($criteria);
				$this->collUsuarioEstudiosRelatedByUsuarioId = UsuarioEstudioPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(UsuarioEstudioPeer::USUARIO_ID, $this->getId());

				UsuarioEstudioPeer::addSelectColumns($criteria);
				if (!isset($this->lastUsuarioEstudioRelatedByUsuarioIdCriteria) || !$this->lastUsuarioEstudioRelatedByUsuarioIdCriteria->equals($criteria)) {
					$this->collUsuarioEstudiosRelatedByUsuarioId = UsuarioEstudioPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastUsuarioEstudioRelatedByUsuarioIdCriteria = $criteria;
		return $this->collUsuarioEstudiosRelatedByUsuarioId;
	}

	
	public function countUsuarioEstudiosRelatedByUsuarioId($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseUsuarioEstudioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(UsuarioEstudioPeer::USUARIO_ID, $this->getId());

		return UsuarioEstudioPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addUsuarioEstudioRelatedByUsuarioId(UsuarioEstudio $l)
	{
		$this->collUsuarioEstudiosRelatedByUsuarioId[] = $l;
		$l->setUsuarioRelatedByUsuarioId($this);
	}


	
	public function getUsuarioEstudiosRelatedByUsuarioIdJoinEstudio($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseUsuarioEstudioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collUsuarioEstudiosRelatedByUsuarioId === null) {
			if ($this->isNew()) {
				$this->collUsuarioEstudiosRelatedByUsuarioId = array();
			} else {

				$criteria->add(UsuarioEstudioPeer::USUARIO_ID, $this->getId());

				$this->collUsuarioEstudiosRelatedByUsuarioId = UsuarioEstudioPeer::doSelectJoinEstudio($criteria, $con);
			}
		} else {
									
			$criteria->add(UsuarioEstudioPeer::USUARIO_ID, $this->getId());

			if (!isset($this->lastUsuarioEstudioRelatedByUsuarioIdCriteria) || !$this->lastUsuarioEstudioRelatedByUsuarioIdCriteria->equals($criteria)) {
				$this->collUsuarioEstudiosRelatedByUsuarioId = UsuarioEstudioPeer::doSelectJoinEstudio($criteria, $con);
			}
		}
		$this->lastUsuarioEstudioRelatedByUsuarioIdCriteria = $criteria;

		return $this->collUsuarioEstudiosRelatedByUsuarioId;
	}

	
	public function initUsuarioEstudiosRelatedByCreatedBy()
	{
		if ($this->collUsuarioEstudiosRelatedByCreatedBy === null) {
			$this->collUsuarioEstudiosRelatedByCreatedBy = array();
		}
	}

	
	public function getUsuarioEstudiosRelatedByCreatedBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseUsuarioEstudioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collUsuarioEstudiosRelatedByCreatedBy === null) {
			if ($this->isNew()) {
			   $this->collUsuarioEstudiosRelatedByCreatedBy = array();
			} else {

				$criteria->add(UsuarioEstudioPeer::CREATED_BY, $this->getId());

				UsuarioEstudioPeer::addSelectColumns($criteria);
				$this->collUsuarioEstudiosRelatedByCreatedBy = UsuarioEstudioPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(UsuarioEstudioPeer::CREATED_BY, $this->getId());

				UsuarioEstudioPeer::addSelectColumns($criteria);
				if (!isset($this->lastUsuarioEstudioRelatedByCreatedByCriteria) || !$this->lastUsuarioEstudioRelatedByCreatedByCriteria->equals($criteria)) {
					$this->collUsuarioEstudiosRelatedByCreatedBy = UsuarioEstudioPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastUsuarioEstudioRelatedByCreatedByCriteria = $criteria;
		return $this->collUsuarioEstudiosRelatedByCreatedBy;
	}

	
	public function countUsuarioEstudiosRelatedByCreatedBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseUsuarioEstudioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(UsuarioEstudioPeer::CREATED_BY, $this->getId());

		return UsuarioEstudioPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addUsuarioEstudioRelatedByCreatedBy(UsuarioEstudio $l)
	{
		$this->collUsuarioEstudiosRelatedByCreatedBy[] = $l;
		$l->setUsuarioRelatedByCreatedBy($this);
	}


	
	public function getUsuarioEstudiosRelatedByCreatedByJoinEstudio($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseUsuarioEstudioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collUsuarioEstudiosRelatedByCreatedBy === null) {
			if ($this->isNew()) {
				$this->collUsuarioEstudiosRelatedByCreatedBy = array();
			} else {

				$criteria->add(UsuarioEstudioPeer::CREATED_BY, $this->getId());

				$this->collUsuarioEstudiosRelatedByCreatedBy = UsuarioEstudioPeer::doSelectJoinEstudio($criteria, $con);
			}
		} else {
									
			$criteria->add(UsuarioEstudioPeer::CREATED_BY, $this->getId());

			if (!isset($this->lastUsuarioEstudioRelatedByCreatedByCriteria) || !$this->lastUsuarioEstudioRelatedByCreatedByCriteria->equals($criteria)) {
				$this->collUsuarioEstudiosRelatedByCreatedBy = UsuarioEstudioPeer::doSelectJoinEstudio($criteria, $con);
			}
		}
		$this->lastUsuarioEstudioRelatedByCreatedByCriteria = $criteria;

		return $this->collUsuarioEstudiosRelatedByCreatedBy;
	}

	
	public function initUsuarioEstudiosRelatedByUpdateBy()
	{
		if ($this->collUsuarioEstudiosRelatedByUpdateBy === null) {
			$this->collUsuarioEstudiosRelatedByUpdateBy = array();
		}
	}

	
	public function getUsuarioEstudiosRelatedByUpdateBy($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseUsuarioEstudioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collUsuarioEstudiosRelatedByUpdateBy === null) {
			if ($this->isNew()) {
			   $this->collUsuarioEstudiosRelatedByUpdateBy = array();
			} else {

				$criteria->add(UsuarioEstudioPeer::UPDATE_BY, $this->getId());

				UsuarioEstudioPeer::addSelectColumns($criteria);
				$this->collUsuarioEstudiosRelatedByUpdateBy = UsuarioEstudioPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(UsuarioEstudioPeer::UPDATE_BY, $this->getId());

				UsuarioEstudioPeer::addSelectColumns($criteria);
				if (!isset($this->lastUsuarioEstudioRelatedByUpdateByCriteria) || !$this->lastUsuarioEstudioRelatedByUpdateByCriteria->equals($criteria)) {
					$this->collUsuarioEstudiosRelatedByUpdateBy = UsuarioEstudioPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastUsuarioEstudioRelatedByUpdateByCriteria = $criteria;
		return $this->collUsuarioEstudiosRelatedByUpdateBy;
	}

	
	public function countUsuarioEstudiosRelatedByUpdateBy($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseUsuarioEstudioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(UsuarioEstudioPeer::UPDATE_BY, $this->getId());

		return UsuarioEstudioPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addUsuarioEstudioRelatedByUpdateBy(UsuarioEstudio $l)
	{
		$this->collUsuarioEstudiosRelatedByUpdateBy[] = $l;
		$l->setUsuarioRelatedByUpdateBy($this);
	}


	
	public function getUsuarioEstudiosRelatedByUpdateByJoinEstudio($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseUsuarioEstudioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collUsuarioEstudiosRelatedByUpdateBy === null) {
			if ($this->isNew()) {
				$this->collUsuarioEstudiosRelatedByUpdateBy = array();
			} else {

				$criteria->add(UsuarioEstudioPeer::UPDATE_BY, $this->getId());

				$this->collUsuarioEstudiosRelatedByUpdateBy = UsuarioEstudioPeer::doSelectJoinEstudio($criteria, $con);
			}
		} else {
									
			$criteria->add(UsuarioEstudioPeer::UPDATE_BY, $this->getId());

			if (!isset($this->lastUsuarioEstudioRelatedByUpdateByCriteria) || !$this->lastUsuarioEstudioRelatedByUpdateByCriteria->equals($criteria)) {
				$this->collUsuarioEstudiosRelatedByUpdateBy = UsuarioEstudioPeer::doSelectJoinEstudio($criteria, $con);
			}
		}
		$this->lastUsuarioEstudioRelatedByUpdateByCriteria = $criteria;

		return $this->collUsuarioEstudiosRelatedByUpdateBy;
	}

} 